ASP.NET ',' 附近有语法错误。 字符串 '' 后的引号不完整。
SqlConnectionCon=newSqlConnection("server=.\\sql2005;database=网上书店;integratedsecurity...
SqlConnection Con = new SqlConnection("server=.\\sql2005;database=网上书店;integrated security=sspi");
//Con.ConnectionString = "server=.;databease=网上书店;integrated security=sspi";
SqlCommand Com = new SqlCommand();
Com.Connection = Con;
Com.CommandText = "insert into zhuce(用户名,密码,姓名,性别,出生日期,联系地址,邮政编码,联系电话,手机,身份证号)"
+ "values('" + this.txt_User_Name.Text + "','" + this.txt_User_Pwd.Text + "','" + this.txt_Ral_Name + "',"
+ "'" + this.DDL_Sex.SelectedItem.Text + "','" + this.DDL_Year.SelectedItem.Text + "-" + this.DDL_Month.SelectedItem.Text+ "-" +this.DDL_Day. SelectedItem.Text + "',"
+ "'" + this.txt_Address.Text + "','" + this.txt_Postalcode.Text + "','" + this.txt_Tel.Text + "',"
+ "'" + this.txt_Mobile.Text+"','" + this.txt_ID_Card.Text + "')";
Con.Open();
Com.ExecuteNonQuery();
this.Labinfo.Text = "恭喜您注册成功!";
Con.Close(); 展开
//Con.ConnectionString = "server=.;databease=网上书店;integrated security=sspi";
SqlCommand Com = new SqlCommand();
Com.Connection = Con;
Com.CommandText = "insert into zhuce(用户名,密码,姓名,性别,出生日期,联系地址,邮政编码,联系电话,手机,身份证号)"
+ "values('" + this.txt_User_Name.Text + "','" + this.txt_User_Pwd.Text + "','" + this.txt_Ral_Name + "',"
+ "'" + this.DDL_Sex.SelectedItem.Text + "','" + this.DDL_Year.SelectedItem.Text + "-" + this.DDL_Month.SelectedItem.Text+ "-" +this.DDL_Day. SelectedItem.Text + "',"
+ "'" + this.txt_Address.Text + "','" + this.txt_Postalcode.Text + "','" + this.txt_Tel.Text + "',"
+ "'" + this.txt_Mobile.Text+"','" + this.txt_ID_Card.Text + "')";
Con.Open();
Com.ExecuteNonQuery();
this.Labinfo.Text = "恭喜您注册成功!";
Con.Close(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询