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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Button not working

Status
Not open for further replies.

vafishing

Programmer
Jul 18, 2001
35
US
Chrissie you responded to my 7/11/04 concern about datagrid not updating using a update button. You sent me some code. Here is my finding when I used the code.

Here is the original code I was using
Private Sub cmdCustUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCustUpdate.Click
If Not Customer1.GetChanges Is Nothing Then
Try
SqlDataAdapter1.Update(Customer1)
Me.Dispose()
Catch ex As Exception
MsgBox(ex.ToString)
Stop
End Try
End If



I am okay until I enter this code

con.connectionstring= ... it has a problem with the ...

Also, the names of my tables are cutomer and account. Account ID is a fk in customer. In my sqldatadapter1, I used query bulder to link the 2 tables together. So when I get to the code: com.commandtext = "select * from table", should I replace it with com.commandtext = "select * from customer, accounts"

Finally would I be able to put all of the code in the cmd button, including the try catch exception?

Also I used a datagrid because I had trouble figuring out how to put a new form within the existing form. I know about the dataform feature but it does not give you an update feature.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top