ASP中如何编写代码要求文本框中内容只能是男或女
strings;if(RadioButton1.Checked)s=RadioButton1.Text;elses=RadioButton2.Text;stringstr...
string s ;
if (RadioButton1.Checked)
s = RadioButton1.Text;
else
s = RadioButton2.Text;
string strVal = "'" + TxtVirname.Text + "','" + Txtpwd.Text + "','" +s + "','" + TxtTruename.Text + "','" + Txtemail.Text + "','"+Txtphone +"'";
string strAcc = "insert into 注册表 (会员名称,会员密码,性别,真实姓名,e-mail,电话) values (" + strVal + ")";
OleDbCommand com=new OleDbCommand (strAcc,conn);
com.ExecuteNonQuery ();
conn.Close();
感觉没有错啊 提示insert语句有错 不知道哪错了 展开
if (RadioButton1.Checked)
s = RadioButton1.Text;
else
s = RadioButton2.Text;
string strVal = "'" + TxtVirname.Text + "','" + Txtpwd.Text + "','" +s + "','" + TxtTruename.Text + "','" + Txtemail.Text + "','"+Txtphone +"'";
string strAcc = "insert into 注册表 (会员名称,会员密码,性别,真实姓名,e-mail,电话) values (" + strVal + ")";
OleDbCommand com=new OleDbCommand (strAcc,conn);
com.ExecuteNonQuery ();
conn.Close();
感觉没有错啊 提示insert语句有错 不知道哪错了 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询