DataAdapter.Fill order

A

Aziz

I'm using VB .NET 2003 and Access 2000

I have a several DataTables in my XML Schema that are linked using
DataRelations (My original Access databse still has the same
relations). However when I fill the DataAdapters (I assume in the
correct order) I get the following error:
Additional information: Failed to enable constraints. One or more rows
contain values violating non-null, unique, or foreign-key constraints.

I need to work with the AlloyComposition table, I've filled all parent
tables first:
daBaseMetalStocks.Fill(dsTurbobraze, "BaseMetalStocks")
daBaseMetalAlloy.Fill(dsTurbobraze, "BaseMetalAlloy")
daPowderSize.Fill(dsTurbobraze, "PowderSize")
daPremadeStocks.Fill(dsTurbobraze, "PremadeStocks")
daAlloyComposition.Fill(dsTurbobraze, "AlloyComposition")

Why am I getting this?

Here's the XML Schema as a printscreen:
http://img81.imageshack.us/img81/3697/datasetscreen11lb.jpg

And as a file:
http://www.mytempdir.com/604239
http://www.filefactory.com/?211f10

Any help appreciated.
 
A

Aziz

I've isolated the problem to the AlloyComposition table. If I remove
all relations except the two relations connecting BaseMetalStocks,
BaseMetalAlloy and AlloyComposition I still get the error (though if I
need to load just the first two it works fine)
 
A

Aziz

This is completely bizarre and very very annoying. The problem just
seemed to have solved itself after me messing around with the fill
command, deleting and re-adding datarelations. Although I'm pretty sure
nothing has changed in my code (it looks the same as the nonworking
version, same too with DataRelations).

Damn ADO >:|
 
J

johneevo

I'm using VB .NET 2003 and Access 2000

I have a several DataTables in my XML Schema that are linked using
DataRelations (My original Access databse still has the same
relations). However when I fill the DataAdapters (I assume in the
correct order) I get the following error:
Additional information: Failed to enable constraints. One or more rows
contain values violating non-null, unique, or foreign-key constraints.

I need to work with the AlloyComposition table, I've filled all parent
tables first:
daBaseMetalStocks.Fill(dsTurbobraze, "BaseMetalStocks")
daBaseMetalAlloy.Fill(dsTurbobraze, "BaseMetalAlloy")
daPowderSize.Fill(dsTurbobraze, "PowderSize")
daPremadeStocks.Fill(dsTurbobraze, "PremadeStocks")
daAlloyComposition.Fill(dsTurbobraze, "AlloyComposition")

Why am I getting this?

Hi Aziz,

I know of 2 ways around this problem. One is to fill your DataTables
children first. For example, if I read your diagram correctly and
BaseMetalStocks is the Parent table, fill BaseMetalAlloy then
BaseMetalStocks. The other way is to set the EnforceConstraints
property to False, fill the DataTables and then set EnforceConstraints
back to True (assuming you want constraints enforced).
 
A

Aziz

I had thought my child DataTables WERE filled first, but despite the
fact it looked right it woudn't work (although it seems to have fixed
itself now, how I don't know)

Thanks johneevo, if the same problem comes up again I will try changing
the EnforceConstraints property.
 
Top