Check Null boolean for IDataRecord

Niladri.Biswas
Posted by Niladri.Biswas under C# category on | Points: 40 | Views : 1079
public static Boolean CheckNullBoolean(this IDataRecord reader, int ordinal)
{
if (reader == null) throw new ArgumentNullException("reader");
return reader.IsDBNull(ordinal) ? false : Convert.ToBoolean(reader.GetValue(ordinal), InvariantCulture);
}

Comments or Responses

Login to post response