#1 IDbCommand.ExecuteScalar()

closed
nobody
None
5
2003-01-28
2002-11-18
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

  • Manuel Lucas Viñas Livschitz

    Logged In: YES
    user_id=406263

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

     
  • Manuel Lucas Viñas Livschitz

    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks