I\'m getting this exception:
The parameterized query \'(@Name nvarchar(8),@type nvarchar(8),@units nvarchar(4000),@rang\' expects the parameter \'@uni
This is a method to be reused with multiple parameters:
public void NullorEmptyParameter(QC.SqlCommand command, string at, string value)
{
if (String.IsNullOrEmpty(value))
{
command.Parameters.AddWithValue(at, DBNull.Value);
}
else
command.Parameters.AddWithValue(at, value);
}
And then you can reuse it for as many commands and params:
NullorEmptyParameter(command, "@Idea_ID", Idea_ID);
NullorEmptyParameter(command, "@Opportunities_or_Idea", Opportunities_or_Idea);