C# 连接Access 的奇怪问题?(请指教)
我用C#连接Access一直出错:
代码: String connectionString = @ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\DB\User.mdb ";
OleDbConnection connection = new OleDbConnection();
OleDbCommand command = new OleDbCommand();
connection.ConnectionString = connectionString;
command.Connection = connection;
connection.Open();
command.CommandText = "delete * from User where id=1 ";
command.ExecuteNonQuery();
connection.Close();
数据库权限没问题。
错误是:执行SQL语句出错!System.Data.OleDb.OleDbException: FROM 子句语法错误。
请指教!!!!!!!!!!
[解决办法]
user 是关键字。改为:
delete * from [User] where id=1