Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1 IDbCommand.ExecuteScalar()

closed
nobody
None
5
2003-01-28
2002-11-18
Vincent Daron
No

Hello

Great work !

Wy the IDBCommand.ExecuteScalar() is not
supported ?

I'm probably missing something but it's not something
as simple as this ?

object ReturnValue = null;

IDataReader aReader = null;
try
{
aReader = ExecuteReader();
if(aReader.Read())
{
ReturnValue = aReader.GetValue(0);
}
}
catch(Exception e)
{
// Log ?
// throw ? => See doc
}
finally
{
if(aReader != null)
{
aReader.Close();
}
}

return ReturnValue;

Discussion

  • Logged In: YES
    user_id=406263

    As a special case of DataReader was not implemented
    because I understand that it is redundant.

     
    • status: open --> closed