ExecuteScalar function question

  • Thread starter Thread starter awiesendanger
  • Start date Start date
A

awiesendanger

Does the ExecuteScalar function use a DataReader behind the scenes? I
had 2 objects that used the same IDbConnection object, and each
object called ExecuteScalar(neither called ExecuteReader). One
completed successfully, the other got the error that a DataReader was
already opened and must be closed first. So I guess ExecuteScalar
uses a Reader?
 
Yes, it does. The Fill method of the data adapter uses it behind the scenes
as well.

awiesendanger said:
Does the ExecuteScalar function use a DataReader behind the scenes? I
had 2 objects that used the same IDbConnection object, and each
object called ExecuteScalar(neither called ExecuteReader). One
completed successfully, the other got the error that a DataReader was
already opened and must be closed first. So I guess ExecuteScalar
uses a Reader?
 

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