none
DataSet.Load stops reading multi-result stored procedure RRS feed

  • Question

  • I have a stored procedure that returns multiple resultsets and have verified the stored procedure works by executing it at the server. When I call the stored procedure using ADO.NET and attempt to load a DataSet using DataSet.Load( IDataReader, LoadOptions, string[] ), the loading process stops when reading the largest result set, containing 24,000 records. To do stress testing, I tried a "SELECT *" on the largest table in the database, containing 94,000 records, and called DataSet.Load on the ad-hoc datareader. This loaded the data without a problem. Is there a problem with DataSet.Load on a multi-result stored procedure?
    Wednesday, March 26, 2008 3:34 PM

Answers

  • This should work fine but you need to make sure to includ the table names in the call to Load that you want to fill.  It will only consume as many results as tables that you pass in.  For illustrative purposes:

     

    DataSet.Load(reader, option, "table1") - will only consume 1 result

    DataSet.Load(reader, option, "table1", "table2") - will only consume at most 2 results

     

    Does this solve your problem?

     

     

     

     

     

    Wednesday, April 2, 2008 9:38 PM

All replies

  • What happens if you load same DataSet using DataAdapter? Same result? Internally DataAdapter uses DataReader, so you should expect same performance.

    Thursday, March 27, 2008 12:21 PM
    Moderator
  • This should work fine but you need to make sure to includ the table names in the call to Load that you want to fill.  It will only consume as many results as tables that you pass in.  For illustrative purposes:

     

    DataSet.Load(reader, option, "table1") - will only consume 1 result

    DataSet.Load(reader, option, "table1", "table2") - will only consume at most 2 results

     

    Does this solve your problem?

     

     

     

     

     

    Wednesday, April 2, 2008 9:38 PM