LJnel Posted June 26, 2006 Share Posted June 26, 2006 hey therewhen you use an INSERT INTO statement in sql, u fill the columns in the database with the values from a textbox or so on your registration page, like this...Dim myCommand As OleDbCommandmyCommand = New OleDbCommand("Insert INTO Dosent ( DosentNo, DnewPassword, DSecretquestion, DSecretanswer ) Values ( txtlectnewpassword.Text.Trim, ddbpasswordquestion.selecteditem.value, txtpasswordsecretanswer.text.trim )", myConnection)------------------------------------------------------------BUT, how do u get a value from a dropdownbox into the column in the database?? or am i using it right as i hav e shown here?------------------------------------------------------------myCommand.ExecuteNonQuery()myConnection.Close() Link to comment Share on other sites More sharing options...
aspnetguy Posted June 26, 2006 Share Posted June 26, 2006 OleDbCommand("Insert INTO Dosent ( DosentNo, DnewPassword, DSecretquestion, DSecretanswer ) Values ( txtlectnewpassword.Text.Trim, ddbpasswordquestion.selecteditem.value, txtpasswordsecretanswer.text.trim )", myConnection)close but not quite.OleDbCommand("Insert INTO Dosent ( DosentNo, DnewPassword, DSecretquestion, DSecretanswer ) Values ( '" & txtlectnewpassword.Text.Trim & "','" & ddbpasswordquestion.selecteditem.value & "','" & txtpasswordsecretanswer.text.trim &"' )", myConnection) You can take out the (') if the column is not a string. Link to comment Share on other sites More sharing options...
LJnel Posted June 26, 2006 Author Share Posted June 26, 2006 thank you, i will try it 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