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
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
相关文章推荐
- Unable to open the physical file "d:\***.mdf". Operating system error 5: "5(Access is denied.)".
- delphi与access的parameters.ParamByName提示"insert into''语法错误
- PRB: "Requested Registry Access Is Not Allowed" Error Message When ASP.NET Application Tries to Write New EventSource in the Eve
- About Derby "ERROR 42X51: The class '***' does not exist or is inaccessible. This can hap pen if the class is not public."
- Server Error in '/' Application. Access to the Path Is Denied" error message appears
- The error about "Attempt to access the method failed"
- AdventureWorksDW2008R2 attach: Unable to open the physical file. Operating system error 5: "5(Access is denied.)
- 解决文件图片等上传DebugFilesKeyError: You tried to access the file "file" in the request
- mysql "insert into select"与"select into"两种表复制
- ERROR: "The service 'Informatica Services' cannot be removed
- Error -27791: Server "" has shut down the connection prematurely的一个解决办法
- mybatis 批量insert,update报错 The error occurred while setting parameters
- ERROR ITMS-90206:"Invalid Bundle. The bundle at 'XXX.appex' contains disallowed file 'Frameworks'."
- Error "The form cannot be rendered. This may be due to a misconfiguration......"的解决方案
- 解决插入移动硬盘出现“Please Insert a Disk into Drive"的问题
- Warning: Using a password on the command line interface can be insecure .ERROR 1045 (28000): Access
- Error message "there are no property pages for the selection"
- 运行某应用系统一模快时提示:Error creating object Please verify that the Microsoft Data Access Components 2.1 (or later) have been pro
- 向Access中插入数据报“INSERT INTO 语句的语法错误”的解决办法
- Cool, i have fixed the "Access violation writing to 0x00000008" of BlackBerry Simulator(JDE5.0)