The "Insert Into" error about Access

When I use the follow code to update Access DataBase, have a error said : "Insert Into error"

1OleDbConnection conn = new OleDbConnection(ConnectString);
2        conn.Open();
3        string sql = "select * from table1";
4        OleDbDataAdapter DataAdapter = new OleDbDataAdapter(sql, conn);
5        OleDbCommandBuilder c = new OleDbCommandBuilder(DataAdapter);
6        DataAdapter.Update(dataSet,"Table");
7        dataSet.AcceptChanges();
8        conn.Close();

I search many resault, at last, I find the reason

In the Access table, I used a column named "guid", because "guid" is reserved key work for access, so after a change the clomun name, all are OK. Thanks for 唯. The follow is his/her blog:

http://hi.baidu.com/onlynet/blog/item/40e73597d2ebb36d55fb9684.html

posted on 2007-03-10 15:54  广思  阅读(277)  评论(0编辑  收藏  举报

导航