471,310 Members | 1,490 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,310 software developers and data experts.

Update to database problem

Ron
I am new to .NET and am trying to build a little prototype web app that deals
with information about loans. I have been reading several books, which has
been helpful, but I am having a terrible time getting changes to a dataset
posted back to the SQL database table (named "tblGeneral").

The app has a combo box that is populated by a SQLDataAdapter and DataSet.
When the user makes a selection in the combo box, a second SQLDataAdapter is
populated with a single row from a second DataSet. The second dataset is
named "LoanDetails".

So far so good. The combo box correctly loads the contents of the DataSet
"LoanDetails". There are four text boxes on the webform and the Databind()
works just fine. If I make a change to one of the text box entries and try
to update the SQL database table, nothing happens. I have been trying to
figure this out for a long time and can't seem to get it right.

I have a button on the webform with the following code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

SqlConnection1.Open()
Try
SqlDataAdapter2.Update(LoanDetails, "tblGeneral")
LoanDetails.tblGeneral.AcceptChanges()
Catch
Response.Write("Error")
End Try

SqlConnection1.Close()
End Sub

Please help - this is driving me crazy. Thanks very much in advance.
Ron

Jul 21 '05 #1
0 884

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mark | last post: by
16 posts views Thread by Philip Boonzaaier | last post: by
13 posts views Thread by abdoly | last post: by
5 posts views Thread by PAUL | last post: by
8 posts views Thread by Zorpiedoman | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.