用户代码未处理 System.ArgumentException,Message="不支持关键字: “pws” 20
出错的代码如下:SqlConnectionobjConnection=newSqlConnection(strConnect);SqlCommandobjCommand=...
出错的代码如下:
SqlConnection objConnection = new SqlConnection(strConnect);
SqlCommand objCommand = new SqlCommand("", objConnection);
objCommand.CommandText = "SELECT USERNAME FORM USERS WHERE USERNAME=@USERNAME";
objCommand.Parameters.Add("USERNAME", SqlDbType.VarChar);
objCommand.Parameters["USERNAME"].Value = tbxUserName.Text.Trim();
SqlConnection objConnection = new SqlConnection(strConnect);
SqlCommand objCommand = new SqlCommand("", objConnection);
objCommand.CommandText = "INSERT INTO USERS" + "(USERNAME,NICKNAME,USERPASSWORD,USEREMAIL,USERROLE,CREATDATE,LASTMODIFYDATE)" + "VALUES" + "(@USERNAME,@NICKNAME,@USERPASSWORD,@USEREMAIL,@USERROLE,@CREATDATE,@LASTMODIFYDATE)";
objCommand.Parameters.Add("USERNAME", SqlDbType.VarChar);
objCommand.Parameters.Add("NICKNAME", SqlDbType.VarChar);
objCommand.Parameters.Add("USERPASSWORD", SqlDbType.VarChar);
objCommand.Parameters.Add("USEREMAIL", SqlDbType.VarChar);
objCommand.Parameters.Add("USERROLE", SqlDbType.Int);
objCommand.Parameters.Add("CREATDATE", SqlDbType.DateTime);
objCommand.Parameters.Add("LASTMDIFDATE", SqlDbType.DateTime);
objCommand.Parameters["USERNAME"].Value = tbxUserName.Text.Trim();
objCommand.Parameters["NICKNAME"].Value = tbxNickName.Text.Trim();
objCommand.Parameters["USERPASSWORD"].Value = tbxPassword.Text.Trim();
objCommand.Parameters["USEREMAIL"].Value = tbxEmail.Text.Trim();
objCommand.Parameters["USERROLE"].Value = 5;
objCommand.Parameters["CREATDATE"].Value = DateTime.Now;
objCommand.Parameters["LASTMDIFDATE"].Value = DateTime.Now; 展开
SqlConnection objConnection = new SqlConnection(strConnect);
SqlCommand objCommand = new SqlCommand("", objConnection);
objCommand.CommandText = "SELECT USERNAME FORM USERS WHERE USERNAME=@USERNAME";
objCommand.Parameters.Add("USERNAME", SqlDbType.VarChar);
objCommand.Parameters["USERNAME"].Value = tbxUserName.Text.Trim();
SqlConnection objConnection = new SqlConnection(strConnect);
SqlCommand objCommand = new SqlCommand("", objConnection);
objCommand.CommandText = "INSERT INTO USERS" + "(USERNAME,NICKNAME,USERPASSWORD,USEREMAIL,USERROLE,CREATDATE,LASTMODIFYDATE)" + "VALUES" + "(@USERNAME,@NICKNAME,@USERPASSWORD,@USEREMAIL,@USERROLE,@CREATDATE,@LASTMODIFYDATE)";
objCommand.Parameters.Add("USERNAME", SqlDbType.VarChar);
objCommand.Parameters.Add("NICKNAME", SqlDbType.VarChar);
objCommand.Parameters.Add("USERPASSWORD", SqlDbType.VarChar);
objCommand.Parameters.Add("USEREMAIL", SqlDbType.VarChar);
objCommand.Parameters.Add("USERROLE", SqlDbType.Int);
objCommand.Parameters.Add("CREATDATE", SqlDbType.DateTime);
objCommand.Parameters.Add("LASTMDIFDATE", SqlDbType.DateTime);
objCommand.Parameters["USERNAME"].Value = tbxUserName.Text.Trim();
objCommand.Parameters["NICKNAME"].Value = tbxNickName.Text.Trim();
objCommand.Parameters["USERPASSWORD"].Value = tbxPassword.Text.Trim();
objCommand.Parameters["USEREMAIL"].Value = tbxEmail.Text.Trim();
objCommand.Parameters["USERROLE"].Value = 5;
objCommand.Parameters["CREATDATE"].Value = DateTime.Now;
objCommand.Parameters["LASTMDIFDATE"].Value = DateTime.Now; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询