我正在尝试将数据添加到 ms access 数据库,它运行没有错误,但数据库没有被修改。我错了还是我忘记了什么?
//using System.Data.OleDb;
private void button2_Click(object sender, EventArgs e)
{
string conStr = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Projects\Cinema.accdb;Persist Security Info=False;";
OleDbConnection con = new OleDbConnection(conStr);
con.Open();
OleDbCommand cmd = new OleDbCommand("insert into seats(number)" + "Values(1)", con);
con.Close();
}