添加问题
OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data source=..\user.mdb");con.Open();
OleDbDataAdapter da = new OleDbDataAdapter("select * from use", con);
DataSet ds = new DataSet();
da.Fill(ds, "use");
string id = this.textBox1.Text;
string name = textBox2.Text;
DataRow dradd;
dradd = ds.Tables["use"].NewRow();
dradd["id"] = textBox1.Text;
dradd["name"] = textBox2.Text;
ds.Tables["use"].Rows.Add(dradd);
da.Update(ds, "use");
MessageBox.Show("添加成功!");
con.Close();
为什么这样不能把textBox1和textBox2里的内容添加到数据库里.
请高手指点!!!~~~