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?
 
Back
Top