Getting a RecorSet returned by a SP

  • Thread starter Thread starter Fabiano
  • Start date Start date
F

Fabiano

Please,

how can i get and read a RecordSet returned by a SQL SERVER stored
procedure?

Tks in adv.

Fabiano
 
You can use a DataReader for instance. Here's an article that will walk you
through calling the proc,
http://www.knowdotnet.com/articles/storedprocsvb.html but instead of calling
..ExecuteNonQuery, declare a DataReader and use myDataReader =
_cmd.ExecuteReader();

Then you can walk it using while(myDataReader.Read()){
//Do Whatever here.
}

Remember though that DataReaders only work when you are connected to the
database and you can only move forward with them. IF you need more
functionality, use a DataSet/DataTable and call a DataAdapter's Fill method
http://msdn.microsoft.com/library/d...tml/cpconpopulatingdatasetfromdataadapter.asp
 
Back
Top