OleDbDataAdapter adp_product =new OleDbDataAdapter("select * from [product] ",conn);
adp_product.Fill(ds,"dt_product");
OleDbCommandBuilder cb_product=new OleDbCommandBuilder(); //增加数据
DataRow newRow;
newRow=ds.Tables["dt_product"].NewRow();newRow["pid"] = textBox1.Text.Trim();ds.Tables["dt_product"].Rows.Add(newRow);
adp_product.Update(ds,"dt_product");
最后一句出错,请问是怎么回事?
adp_product.Fill(ds,"dt_product");
OleDbCommandBuilder cb_product=new OleDbCommandBuilder(); //增加数据
DataRow newRow;
newRow=ds.Tables["dt_product"].NewRow();newRow["pid"] = textBox1.Text.Trim();ds.Tables["dt_product"].Rows.Add(newRow);
adp_product.Update(ds,"dt_product");
最后一句出错,请问是怎么回事?
还是不行
2.select * from [product],你的product表里可能有的字段命名成系统关键字了,改成select [id],[name],....,然后再试一下!