Can Datareader be used instead of Data Adapter to populate the Datagrid
In Windows Forms application using vb.net / access - can datareader be used to populate the datagrid? The datagrid in my form is just for display purposes. Modifications to the data will be handled by double clicking the grid which would take to another form which handles insert /update / delete.
I tried to populate the datagrid with a datareader:
Dim sql As String = "SELECT * FROM Pcardlog where RDM='R'"
Cmd.Connection = Conn
Cmd.CommandText = sql
Conn.Open()
DataGrid1.DataSource = Cmd.ExecuteReader
I get the following error:
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
Could someone throw some light on how to get this to work?
rlehnherrPosted Sep 1, 2004, 3:18 PM
Carlos SanchezPosted Aug 9, 2004, 11:41 AM
nagenderkPosted Aug 6, 2004, 2:21 AM
Carlos SanchezPosted Jul 13, 2004, 11:41 AM
Adam ErstellePosted Jul 11, 2004, 12:35 AM
p.jonesPosted Jul 8, 2004, 10:02 AM
Carlos SanchezPosted Jul 7, 2004, 4:25 PM
crend_kingPosted Feb 9, 2004, 10:49 AM
spgilmorePosted Dec 19, 2003, 1:30 PM
dip_2004_05Posted Dec 10, 2003, 10:28 AM