您的位置:首页 > 其它

The "Insert Into" error about Access

2007-03-10 15:54 405 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐