|
-
Apr 19th, 2006, 08:10 PM
#1
Thread Starter
New Member
Saving To A Database
Hi Guys,
There seems to be a little problem with my database application i was wondering if you guys could help. But basically in my application - when you update or add something into the application - it updates it while its still running but if you close down the application it doesnt actually write the changes to the database. The code im using is:
Friend Function SaveData1() As Integer
If IsUpdating Then
Return 0
End If
Dim rowsSaved As Integer = 0
'try to get changes and save to database
Try
'only push update to database if changes are detected
If Me.ExpertDataSet.HasChanges Then
IsUpdating = True
rowsSaved = Me.DisorderTableAdapter.Update(Me.ExpertDataSet.Disorder)
End If
Catch ex As Exception
MsgBox(String.Format("There was a problem saving data: {0}", ex.Message))
My.Application.Log.WriteException(ex)
Finally
IsUpdating = False
End Try
Return rowsSaved
-------------------------
i have tried several others but it doesnt seem to work!!
any ideas? thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|