Jump to content

Radio Btn values in a SQL insert statement


LJnel

Recommended Posts

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

  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...