Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dataset GetChange
Message
From
17/01/2004 12:03:27
Larry Santos
Local Data System
Philippines
 
 
To
All
General information
Forum:
ASP.NET
Category:
ADO.NET
Title:
Dataset GetChange
Miscellaneous
Thread ID:
00867807
Message ID:
00867807
Views:
58
Hi,

I will paste my small code here..

Public Function Save_Product(ByVal ds As DAL.DSMain) As DataSet
Dim objDataSetChanges As DAL.DSMain = New DAL.DSMain()
Dim myDS As DataSet
objDataSetChanges = CType(ds.GetChanges(), DAL.DSMain)
If (Not (objDataSetChanges) Is Nothing) Then
Save_Dataset(objDataSetChanges)
objDataSetChanges.AcceptChanges()
End If
End Function

When I first the function it good but when i run again i got an error encountered
Error:

Object reference not set to an instance of an object.

Private Sub Save_Dataset(ByVal ChangedRows As DAL.DSMain)
Dim DA_Product As SqlDataAdapter = New SqlDataAdapter()
Dim DA_ProductItem As SqlDataAdapter = New SqlDataAdapter()
Dim DA_ProductAcc As SqlDataAdapter = New SqlDataAdapter()

DA_Product.InsertCommand = cmdInsert_Product()
DA_Product.UpdateCommand = cmdUpdate_Product()
DA_Product.DeleteCommand = cmdDelete_Product()

DA_ProductItem.InsertCommand = cmdInsert_ProductItem()
DA_ProductItem.UpdateCommand = cmdUpdate_ProductItem()
DA_ProductItem.DeleteCommand = cmdDelete_ProductItem()

DA_ProductAcc.InsertCommand = cmdInsert_ProductAcc()
DA_ProductAcc.UpdateCommand = cmdUpdate_ProductAcc()
DA_ProductAcc.DeleteCommand = cmdDelete_ProductAcc()


If (Not (ChangedRows) Is Nothing) Then
Try
SQLConn.SQLConn.Open()
DA_Product.Update(ChangedRows, "Product")
DA_ProductItem.Update(ChangedRows, "ProductItem")
DA_ProductAcc.Update(ChangedRows, "Product Accessories")
Catch ex As SystemException
ChangedRows.RejectChanges()
Throw ex
Finally
SQLConn.SQLConn.Close()
End Try
End If

End Sub

anybody can help me for this..


TIA
Next
Reply
Map
View

Click here to load this message in the networking platform