|
-
Jul 22nd, 2004, 01:59 PM
#1
Thread Starter
Addicted Member
How to Save tables(dataset) to database
Hi all GURUs,
I am new in .NET.
Can you please tell me how to:
Save updated tables(dataset) to database.
I my code dosent work, its as follows:
'Caeate new dataset to hold changes from main dataset.
Dim dschanges As DataSet = DsInventory1.GetChanges()
'stop any current edits.
Me.BindingContext(DsInventory1, "Vendor").EndCurrentEdit()
'Get the changes that have been made to main dataset.
dsChanges = CType(DsInventory1.GetChanges, dsInventory)
'Check to see if any changes have been made.
If (Not (dsChanges) Is Nothing) Then
Try
Me.ConnINVENTORY.Open()
'Attempt to update data Source.
DsInventory1.Tables("Vendor").AcceptChanges()
DataAdINVENTORY.Update(dsChanges)
DataAdINVENTORY.Update(DsInventory1, "Vendor")
MsgBox("Record saved Successfully")
Catch updateExcepatoin As System.Exception
MsgBox("Can not save to data Source")
Finally
Me.ConnINVENTORY.Close()
End Try
DsInventory1.Merge(dsChanges)
DsInventory1.AcceptChanges()
End If
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
|