Extension method on SQLDataReader to check Null Decimal

Niladri.Biswas
Posted by Niladri.Biswas under C# category on | Points: 40 | Views : 798
public static decimal CheckNullDecimal(this SqlDataReader dr, int ordinal)
{
return dr.IsDBNull(ordinal) ? decimal.Zero : dr.GetDecimal(ordinal);
}

Comments or Responses

Login to post response