日期:2014-05-16  浏览次数:20894 次

asp.net+access insert into 语法附加有错误
一直用sql刚试下access就出错了
SQL code

  /// <summary>
       /// 注册
       /// </summary>
       /// <param name="user"></param>
       /// <returns></returns>
       public static int AddLoginUser(User user)
       {
         
           string sql = "INSERT INTO User ([Name],[Password],[PurviewID]) VALUES (@Name ,@password ,@purviewId)";
           OleDbParameter[] paras ={ new OleDbParameter("@Name",user.Name),new OleDbParameter("@password",user.Password),
                                     new OleDbParameter("@purviewId",user.Purview.Id)};
           return DBHelper.ExecuteNonQuery(sql,paras);
       }



报insert into语法附近有错误 求助

------解决方案--------------------
string sql = "INSERT INTO [User] ([Name],[Password],[PurviewID]) VALUES (@Name ,@password ,@purviewId)";