Hello,
I'm trying to executed sequence of INSERTs using a prepared command.
The code:
The underlying column name is called userid, and I get back "column userid cannot be null". I've checked that there is a value for "i" at the time of the .Value statement. Any ideas?
Thanks
I'm trying to executed sequence of INSERTs using a prepared command.
The code:
Code:
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = myConn;
cmd.CommandText = "INSERT INTO someTable VALUES (@param)";
cmd.Prepare();
cmd.Parameters.Add("@param", MySqlDbType.Int16);
for (...)
{
cmd.Parameters["@param"].Value = i;
cmd.ExecuteNonQuery();
}
The underlying column name is called userid, and I get back "column userid cannot be null". I've checked that there is a value for "i" at the time of the .Value statement. Any ideas?
Thanks