我正在尝试使用c#将数据插入MS访问表。我有以下代码:
OleDbConnection aConnection = new
OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=storage_db.accdb");
string sql = ("INSERT INTO Client (cname, phone, [password])
VALUES(@Name,@Phone,@Password)");
OleDbCommand insert = new OleDbCommand(sql, aConnection);
aConnection.Open();
insert.Parameters.Add("@Name", OleDbType.VarChar).Value = textBox1.Text;
insert.Parameters.Add("@Phone", OleDbType.VarChar).Value = textBox2.Text;
insert.Parameters.Add("@Password", OleDbType.VarChar).Value = textBox3.Text;
insert.ExecuteNonQuery();
aConnection.Close();
没有错误消息或异常,但数据不会出现在表格中。我做错了什么?