LJnel Posted July 5, 2006 Share Posted July 5, 2006 good morning,i want to write my radio button values to the DB based on which one of the two radio buttons the user selects, do i determine the selection with an if statement and then store the result in a variable and then use the variable in my sql insert statement?? all is done in asp.net..example:if radlectmale.selecteditem.value = "male" then strDGender = "male"else strDGender ="female"end ifDim myCommand As OleDbCommandmyCommand = New OleDbCommand("Insert INTO Dosent ( DnewPassword, DSecretquestion, DGender ) Values (" & txtlectnewpassword.Text.Trim & ", " & ddbpasswordquestion.SelectedItem.Value & ", " & strDGender & " )", myConnection)myCommand.ExecuteNonQuery()myConnection.Close()thank you Link to comment Share on other sites More sharing options...
pulpfiction Posted August 17, 2006 Share Posted August 17, 2006 If you are giving the value value="male" and value="Female" for the radio button, you can avoid IF statement. try something like this...dim strDGender as stringstrDGender = radlectmale.selecteditem.value Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now