To pass a value that could be null use the following:
int? recordID = null; var parameter = new System.Data.SqlClient.SqlParameter { ParameterName = "@id", SqlDbType = SqlDbType.Int, Value = (object)recordID ?? DBNull.Value, }; |
To pass a value that could be null use the following:
int? recordID = null; var parameter = new System.Data.SqlClient.SqlParameter { ParameterName = "@id", SqlDbType = SqlDbType.Int, Value = (object)recordID ?? DBNull.Value, }; |