L
Lars Beyer-Olsen
Hi.
I got a problem with the OleDbDataAdapter object in .Net.
The case is:
I fill a dataset with data from an XML-file. This works fine.
I then want to store the data into a database. This also seems to work
fine.
The problem ouccurs when I try to update the data in the table. If I
read the same XML-file into the dataset and perform the Update method
of the dataadapter it throws this Exception:
ORA-00001: unique constraint (SOME.TABLE) violated
Source code:
################################################################
Dim cb As New OleDbCommandBuilder(OleDbDataAdapter1)
DataSet1.ReadXmlSchema( _
"H:\temp\foo.xsd")
DataSet1.ReadXml( _
"H:\temp\foo.xml")
OleDbDataAdapter1.Update(DataSet1)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
################################################################
It seem to me that the dataadapter trys to do an insert and fails
because there
already is a row with the same values in the table.
Anyone got a clue how to solve this?
Lars
I got a problem with the OleDbDataAdapter object in .Net.
The case is:
I fill a dataset with data from an XML-file. This works fine.
I then want to store the data into a database. This also seems to work
fine.
The problem ouccurs when I try to update the data in the table. If I
read the same XML-file into the dataset and perform the Update method
of the dataadapter it throws this Exception:
ORA-00001: unique constraint (SOME.TABLE) violated
Source code:
################################################################
Dim cb As New OleDbCommandBuilder(OleDbDataAdapter1)
DataSet1.ReadXmlSchema( _
"H:\temp\foo.xsd")
DataSet1.ReadXml( _
"H:\temp\foo.xml")
OleDbDataAdapter1.Update(DataSet1)
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
################################################################
It seem to me that the dataadapter trys to do an insert and fails
because there
already is a row with the same values in the table.
Anyone got a clue how to solve this?
Lars