Fill a datagrid with a datareader ?
Hi,
In VB.NET 2003.
Is it possible to fill a datagrid with a datareader?
Code:
'This line works .. data are correctly read.
sqlDataReader = sqlCommand.ExecuteReader
'This line crashes ..
grdGrid.DataSource = sqlDataReader
I get the error:
Error : Complex DataBinding accepts as a data source either an IList or an IListSource
Re: Fill a datagrid with a datareader ?
That works with the WebForms DataGrid but not the WinForms version. You need to populate a DataTable and bind that.
Re: Fill a datagrid with a datareader ?
Ok thanks.
That is what I did.