If I create a parameter as in the following, and if the value is null, I get an error even though I handle null values in the stored procedure.
objCommand.Parameters.Add("@ID", SqlDbType.Int).Value = hfID.Value; The datatype in the database is int, and so I tend to use that same type in the definition of the parameter.  But if I change the data type to varchar or nchar, I don't have a problem as in the following.
objCommand.Parameters.Add("@ID", SqlDbType.NChar,10).Value = hfID.Value;Is it a bad idea to just set the parameters as varchar's or nchars' to avoid getting errors? My stored procedure checks for null values, but I get an error before even getting there.

Go to the complete details ...