Datagrid e select

martedì 26 settembre 2006 - 16.08

bluland Profilo | Guru

salve,

da quello che so a differenza di asp.net in vb.net non bisogna fare il databind, cosi ho fatto la seguente prova:

Dim s As String = "select * from tabella" Me.SqlConnection1.Open() Dim cmd As New SqlCommand(s, Me.SqlConnection1) Dim read As SqlDataReader read = cmd.ExecuteReader(CommandBehavior.CloseConnection) Me.DataGrid1.DataSource = read

ma mi da il seguente errore:

An unhandled exception of type 'System.Exception' occurred in system.windows.forms.dll

Additional information: Complex DataBinding accepts as a data source either an IList or an IListSource

cosa ho sbagliato?

saluti

ENzo
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5