I have a subroutine to insert a record to sql server table. The code:
public void Insert_Met(int Counts, char Gender)
{
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("@Counts", Counts);
parameters.Add("@Gender", Gender);
// run a stored procedure ExecuteNonQuery
}
I other line code,
int counts = Convert.ToInt32(numberUpdowncontrol1.Text);
// from a control, maybe empty then it is null.
Insert_Met(counts,'M');
My question is sometimes Counts can be null, so how to change my code?
Thanks,