SQLDataReader not working

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

Guest

Hi,

I am trying to read data from a stored procedure(SP) using the
SQLDataReader. Inside SP, i populate a temp table (created using SQL Table
variable) with some records based upon some logic. Last statement in the SP,
selects few records from the temp table.

The SQLDataReader on the client side returns zero records sometimes(which is
not expected) and 5 records sometimes(which is expected) and this happens
alternatively. 5,0,5,0...

what is it that i am missing.

Thanks,
Yash
 
This sounds like a bug in your code or stored procedure, causing it to give
these results. Since your provided just vague details, that's about all I
can say.
 
If you have more than one statement, check the NextResult property. The
problem may be that the first query isn't returning rows, but you have
multiple resultsets. That's my first guess. Check NextResult (Use a While
loop) which may help you. If not, just let me know and maybe you can post
the code
 
Back
Top