[已关闭问题]
<P>体彩36选7.。用8个文体框来插入。。高手帮忙一下。。就是当文本框5里输入7就自动在将7写入C7。。其它类似。。</P>
<P> protected void Button1_Click(object sender, EventArgs e)<BR> {<BR> if(!Page.IsPostBack)<BR> {<BR> string qnum, c1, c2,c3,c4,c5,c6,c7;</P>
<P> qnum = TextBox8.Text;<BR> c1 = TextBox1.Text;<BR> c2 = TextBox2.Text;<BR> c3 = TextBox3.Text;<BR> c4 = TextBox4.Text;<BR> c5 = TextBox5.Text;<BR> c6 = TextBox6.Text;<BR> c7 = TextBox7.Text;<BR> <BR>lhccon = ConfigurationManager.ConnectionStrings["lhcConnectionString"].ToString().Trim();<BR> SqlConnection mycon = new SqlConnection(lhccon);<BR> mycon.Open();<BR> string cmd = "insert into [zst]([qnum],[b1],[b2],[b3],[b4],[b5],[b6],[b7]) values ('"+qnum +"','" + c1 + "','" + c2 + "','" + c3 + "','" + c4 + "','" + c5 + "','" + c6 + "','" + c7 + "')";<BR> SqlCmd = new SqlCommand(cmd, mycon);<BR> SqlCmd.ExecuteNonQuery();<BR> mycon.Close();<BR> }<BR> <BR> }</P>