Burak Seyhan

Burak Seyhan

  • NA
  • 321
  • 30.1k

Access C# Data Insert Problem

Jun 17 2017 6:46 PM
string SqlString = "Insert Into tb_Users (UserName, Password,IsDeleted) Values (?,?,?)";
using (OleDbCommand cmd = new OleDbCommand(SqlString, myCon))
{
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("UserName", "asd");
cmd.Parameters.AddWithValue("Password", "asdsadasdas");
cmd.Parameters.AddWithValue("IsDeleted", "fff");
myCon.Open();
cmd.ExecuteNonQuery();
}
 
Why this code doesn't work ? Always insert code return Syntax error in INSERT INTO statement. message. where is the problem please help me 

Answers (4)