I'm working on a .Net Desktop app that uses Access database. I'm using the Contacts form and trying to change the Category field, which has multiple choices in a combo box for value. The value I'm trying to set is in the list of choices, but it doesn't do anything. Here is my code. Please shed some light on what's going on. That code seems to be working for a DELETE command.
string list = string.Join(", ", f);
string ConnStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + txtDB.Text + "";
string ComStr = "UPDATE Contacts SET Category = ? where [E-mail Address] in (?)";
using (OleDbConnection con = new OleDbConnection(ConnStr))
{
con.Open();
using (OleDbCommand com = new OleDbCommand(ComStr, con))
{
com.Parameters.AddWithValue("List", list);
com.Parameters.AddWithValue("Category", "Не получава мейли");
com.ExecuteNonQuery();
}
con.Close();
}