各位帮我看看下面代码:
SqlConnection connection = new SqlConnection(@"Data Source=.\sqlexpress;AttachDbFilename=E:\leaning\C #Lean\C#Project\WebSite2\App_Data\Users.mdf;Integrated Security=True");
SqlDataAdapter thisAdapter = new SqlDataAdapter("SELECT * FROM User", connection);
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "User");运行是总提示: 关键字 'User' 附近有语法错误
请问是什么原因
SqlConnection connection = new SqlConnection(@"Data Source=.\sqlexpress;AttachDbFilename=E:\leaning\C #Lean\C#Project\WebSite2\App_Data\Users.mdf;Integrated Security=True");
SqlDataAdapter thisAdapter = new SqlDataAdapter("SELECT * FROM User", connection);
SqlCommandBuilder thisBuilder = new SqlCommandBuilder(thisAdapter);
DataSet thisDataSet = new DataSet();
thisAdapter.Fill(thisDataSet, "User");运行是总提示: 关键字 'User' 附近有语法错误
请问是什么原因
因为user在sql中是关键字
con.open
那User到底是什么时候用?
加上[User]