The "Insert Into" error about Access
When I use the follow code to update Access DataBase, have a error said : "Insert Into error"
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
1
OleDbConnection 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();
OleDbConnection 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
浙公网安备 33010602011771号