用户代码未处理 sql Exception',' 附近有语法错误;代码如下
代码如下://1连接数据库SqlConnectionconn=newSqlConnection();conn.ConnectionString=Configuration...
代码如下:
//1 连接数据库SqlConnection conn = new SqlConnection();conn.ConnectionString = ConfigurationManager.ConnectionStrings["clubConnectionString"].ConnectionString;conn.Open();UpFile();SqlCommand comm = new SqlCommand("insert into UserTable([UId],[Nikename],[Realname],[Upassword],[Ubirth],[Utel],[Usex],[Ucollege],[Professional],[Picture]) values(@UId,@Nikename,@Realname,@Upassword,@Ubirth,@Utel,,@Usex,@Ucollege,@Professional,@Picture)", conn);string filename = FileUpload1.FileName.ToString();string filepath = "photo/user/" + filename;comm.Parameters.AddWithValue("@UId", TextBox4.Text);comm.Parameters.AddWithValue("@Nikename",TextBox2.Text);comm.Parameters.AddWithValue("@Realname",TextBox3.Text);comm.Parameters.AddWithValue("@Upassword",TextBox5.Text);comm.Parameters.AddWithValue("@Ubirth",EntTime.Text);comm.Parameters.AddWithValue("@Utel",TextBox7.Text);comm.Parameters.AddWithValue("@Usex",RadioButtonList1.SelectedValue);comm.Parameters.AddWithValue("@Ucollege",DropDownList1.SelectedValue);comm.Parameters.AddWithValue("@Professional",TextBox6.Text );comm.Parameters.AddWithValue("@Picture",filepath);comm.ExecuteNonQuery();conn.Close();初学者,求助,代码重新写了很多遍了 还是错误的 展开
//1 连接数据库SqlConnection conn = new SqlConnection();conn.ConnectionString = ConfigurationManager.ConnectionStrings["clubConnectionString"].ConnectionString;conn.Open();UpFile();SqlCommand comm = new SqlCommand("insert into UserTable([UId],[Nikename],[Realname],[Upassword],[Ubirth],[Utel],[Usex],[Ucollege],[Professional],[Picture]) values(@UId,@Nikename,@Realname,@Upassword,@Ubirth,@Utel,,@Usex,@Ucollege,@Professional,@Picture)", conn);string filename = FileUpload1.FileName.ToString();string filepath = "photo/user/" + filename;comm.Parameters.AddWithValue("@UId", TextBox4.Text);comm.Parameters.AddWithValue("@Nikename",TextBox2.Text);comm.Parameters.AddWithValue("@Realname",TextBox3.Text);comm.Parameters.AddWithValue("@Upassword",TextBox5.Text);comm.Parameters.AddWithValue("@Ubirth",EntTime.Text);comm.Parameters.AddWithValue("@Utel",TextBox7.Text);comm.Parameters.AddWithValue("@Usex",RadioButtonList1.SelectedValue);comm.Parameters.AddWithValue("@Ucollege",DropDownList1.SelectedValue);comm.Parameters.AddWithValue("@Professional",TextBox6.Text );comm.Parameters.AddWithValue("@Picture",filepath);comm.ExecuteNonQuery();conn.Close();初学者,求助,代码重新写了很多遍了 还是错误的 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询