submit dataset to database
hi everyone,
i'm a newbee on this forum, and looking for help
This is my problem:
I have tried to fill a dataset from a database
this is done bij a stored procedure
(Getting data from multiple tables!)
Here is the code for that part:
..........
ComCD = New OleDbCommand("cmdTwoInOne", MyConn)
Debug.WriteLine("test select: " & intAr_ID)
ComCD.Parameters.Add("@ArtiestID", OleDbType.Integer)
ComCD.Parameters("@ArtiestID").Value = intAr_ID
ComCD.CommandType = CommandType.StoredProcedure
daCDs.SelectCommand = ComCD
daCDs.FillSchema(dsCD, SchemaType.Source, "tblCD")
daCDs.Fill(dsCD, "tblCD")
.......
When i have the dataset i want to update a row in it
no problem so far.
But when i want to submit the changes of the dataset to the database...it goes wrong
Here is the code how i do that:
Public Sub UpdateCD(ByVal test As DataSet)
If MyConn.State = ConnectionState.Open Then
Else
MyConn.Open()
End If
Dim custCD As OleDbCommandBuilder = New OleDbCommandBuilder(myCommand)
myCommand.Update(test, "tblCD"):confused:
......
in the last rule it goes wrong: mycommand.Update(test,"tblCD")
I'm getting this error:
Value null was found where an instance of an object was required.
I don't no why?
Is it because there are combined tables in the dataset?
If so where can i find information on the net on updating database with combined tables?
Can somebody please help me out!
Thanx guys...