G
Giammarco
Hi All,
I have the following code:
SqlCommand sqlCmd = new SqlCommand(sqlStatment, dbConn);
sqlCmd.Parameters.AddWithValue("@Name", name);
sqlCmd.Parameters.AddWithValue("@Surname", surname);
If surname is NULL I get the following error message:
Parameterized Query xyz expects parameter Surname which was not
supplied.
Do you know any workaround? I basically would like to pass NULL values
to the SQL statment, instead of writing different SQL statment
depending on what values the user provides.
Thanks,
Giammarco
I have the following code:
SqlCommand sqlCmd = new SqlCommand(sqlStatment, dbConn);
sqlCmd.Parameters.AddWithValue("@Name", name);
sqlCmd.Parameters.AddWithValue("@Surname", surname);
If surname is NULL I get the following error message:
Parameterized Query xyz expects parameter Surname which was not
supplied.
Do you know any workaround? I basically would like to pass NULL values
to the SQL statment, instead of writing different SQL statment
depending on what values the user provides.
Thanks,
Giammarco