Cursors in ADO.net

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a situation to use cursors in SQL Server. I need to populate DataSet
for the returned rows. So that i could use DataGrid to display the values in
the front end.
Is it possible to populate DataGrid, if i use Cursor in SQL Server. Can
someone give me an example.

Thanks in advace
 
Bob,

Why do you absolutely have to use Server side cursors? Anyway, for a
datagrid, anything that implements IList will databind with a datagrid. So
you could use a datareader or anything that you wish, and populate a custom
object that implements IList and bind it to the datagrid.

Obviously you could instead of all the hardwork above, use a dataset
instead.

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik
 
Thanks for responding. I have one questions that is, if i use a cursor can't
i populate dataset by using fill function of SQLAdapter
 
Datasets are populated by resultsets. As long as your stored proc or
whatever returns what looks like a table (i.e. a select statement) or a
group of tables, the dataset will be populated, What is inside the stored
proc is immaterial.

- Sahil Malik
You can reach me thru my blog http://www.dotnetjunkies.com/weblog/sahilmalik
 
Back
Top