Check Null small int for IDataRecord

Niladri.Biswas
Posted by Niladri.Biswas under C# category on | Points: 40 | Views : 792
public static short CheckNullInt16(this IDataRecord reader, int ordinal)
{
if (reader == null) throw new ArgumentNullException("reader");
return reader.IsDBNull(ordinal) ? (short)0 : reader.GetInt16(ordinal);
}

Comments or Responses

Login to post response