Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing text

Status
Not open for further replies.

Stegmite

Programmer
Aug 18, 2004
36
US
I'm trying to allow the user to edit any information stored in the database. I've tried several combinations, but the text keeps returning to normal after I click a submit button. Please advise.
 
I've got a few text boxes and three combo boxes. They've got AutoPostBack = False and EnableViewState = True. I know its not doing anything because instead of doing the SQL code, I made it just make a label's text one of the text box's information.
 
You got me lost. If I still understand you, what you are trying to do is:

1. Read text from database and display it in a textbox.
2. Let user edit the text.
3. Take edited text from the textbox and update it in the database.

Is this correct?
 
I edited it for just one box, but here's what I have:

Dim vID As String = Session("IDnum")
Dim vTitle As String = txtTitle.Text
Dim myTitle As String
Dim myTitleCommand As New OleDb.OleDbCommand

myTitle = "UPDATE tblMain SET Title = '" & vTitle & "' WHERE ID=" & vID & ""
myTitleCommand = New OleDb.OleDbCommand(myTitle, OleDbConnection1)

OleDbConnection1.Open()
myTitleCommand.ExecuteNonQuery()
OleDbConnection1.Close()
 
Set a breakpoint here:

myTitleCommand = New OleDb.OleDbCommand(myTitle, OleDbConnection1)


And look at the content of "myTitle". What is it?
 
You probably found the problem: the code is probably not being executed.

Is the function contain the update being hit at all?
 
Ok, i put the breakpoint at the Private Sub Submit_Click (the function) and it didn't hit either. But the response.redirect to the previous form is working, that's where I'm confused.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top