Proper way to bind data from sqlserver to datagrid

  • Thread starter Thread starter Cylix
  • Start date Start date
C

Cylix

I am going to show database table to a datagrid.
I try to select the table to a sqlDataReader,
but I found it is not straight to show it to the datagrid.
It needs to convert the sqldatareader to a data table and add the
datatable to a dataset,
then setdatabinding from the datagrid ...

Is it a standard way to load data to the datagrid for display only?

Thanks.
 
Cylix,

You can use the sqlDataReader direct to the ASPX datagrid, probably you have
read about the windonsforms datagrid, which need as you said (although you
can bind direct a datatable as well to that one)

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top