In my database, in one of the table I have a GUID column with allow nulls. I have a method with a Guid? parameter that inserts a new data row in the table. However when I s
You can use a helper method:
public static class Ado {
public static void SetParameterValue( IDataParameter parameter, T? value ) where T : struct {
if ( null == value ) { parameter.Value = DBNull.Value; }
else { parameter.Value = value.Value; }
}
public static void SetParameterValue( IDataParameter parameter, string value ) {
if ( null == value ) { parameter.Value = DBNull.Value; }
else { parameter.Value = value; }
}
}