My code is:
SqlCeConnection sql = new SqlCeConnection(@"Data Source=C:\DB.sdf");
sql.Open();
cmd = new SqlCeCommand("INSERT INTO xxx(aaa) VALUES(@aaa)", sql);
String param = null;
cmd.Parameters.AddWithValue("@aaa", param);
cmd.ExecuteNonQuery();
sql.Close();
(1) throws an exception if paramnull. The database allows a column aaavalue of zero. How to insert zero into table xxx?
An exception:
Parameterized query 'INSERT INTO xxx(aaa) VALUES(@aaa)' expects a parameter value which was not supplied.
source
share