In the above example, you have to use
sqldatadapter
in the place of
sqldatareader
, So the
sqldataadapter
can hold any number of records.
once you get data in to
sqldataadapter
, you have to assign to
datatable
so data table can be assigned as a data source to any grid.
example:
System.data.SqlAdapter da;
datatable dt;
da=new system.data.SqlAdapter ("select * from emp",connection)
dt.fill(da)
now bind dt to your grid