Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Star
14460 Points
2402 Posts
Apr 11, 2012 06:11 AM|LINK
//simple methods if(RadioButton1.Checked) { cmd = New SqlCommand("insert into quser (uans) values('" + RadioButton1.Text + "', con) } else if(RadioButton2.Checked) { cmd = New SqlCommand("insert into quser (uans) values('" + RadioButton2.Text + "', con) } else if(RadioButton3.Checked) { cmd = New SqlCommand("insert into quser (uans) values('" + RadioButton3.Text + "', con) } else if(RadioButton4.Checked) { cmd = New SqlCommand("insert into quser (uans) values('" + RadioButton4.Text + "', con) } cmd.ExecuteNonQuery() //or use radio button list //below code cmd = New SqlCommand("insert into quser (uans) values('" + RadioButtonList.SelectedValue + "', con) cmd.ExecuteNonQuery()
yrb.yogi
Star
14460 Points
2402 Posts
Re: What is the correct syntax ?
Apr 11, 2012 06:11 AM|LINK
//simple methods if(RadioButton1.Checked) { cmd = New SqlCommand("insert into quser (uans) values('" + RadioButton1.Text + "', con) } else if(RadioButton2.Checked) { cmd = New SqlCommand("insert into quser (uans) values('" + RadioButton2.Text + "', con) } else if(RadioButton3.Checked) { cmd = New SqlCommand("insert into quser (uans) values('" + RadioButton3.Text + "', con) } else if(RadioButton4.Checked) { cmd = New SqlCommand("insert into quser (uans) values('" + RadioButton4.Text + "', con) } cmd.ExecuteNonQuery() //or use radio button list //below code cmd = New SqlCommand("insert into quser (uans) values('" + RadioButtonList.SelectedValue + "', con) cmd.ExecuteNonQuery().Net All About