嗨,我已经连接了数据库Ms-access 2010(.mdb)
,C#
然后我想在datagrid
视图中显示它,这是我用来保存的代码或insert the data
OleDbCommand cmd = new OleDbCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "insert into VMS(PlateNo,JobCardNo,Model,DateIn,Status,PartList,PurchNo,PurchDate,Remark)" + "values('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox7.Text + "','" + textBox8.Text + "','" + textBox9.Text + "')";
cmd.Connection = mycon;
mycon.Open();
cmd.ExecuteNonQuery();
mycon.Close();
这很好用,问题是当我保存新数据时,它保存在 MS-access 中,但它不会更新或显示在 datagridview 中。任何帮助将不胜感激