Can Datareader be used instead of Data Adapter to populate the Datagrid

Dec 8 2003 9:34 AM
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?

Answers (10)