Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I want to build a datarelation between an

SQL-Table and an XML-Document.

 

The task is to filter the table (about 10000 records) with a list of ID-Values (about 100) presented in the XML-Doc

 

I create the relation by joining the two tables of the dataset grafically in the designer and this works fine.

 

But when i try to call

 

sqlDataAdapter.Fill (dataset)

 

i get an error telling me, that either the non-null, the unique or the foreign-key constraint are violated

 

can anybody tell me why ??

 

i think my code will not help a lot here, but anyway:

 

 

 

DataSet11.ReadXml("D:\develop\.NET\TESTPROJEKTE\heroldTests\heroldTests\joinTableAndXML5\slave.xml")

childCol = DataSet11.Tables("zbz").Columns("ZAEHLB_ID")

parentCol = DataSet11.Tables("slave").Columns("ZAEHLB_ID")

Dim relMasterSlave As DataRelation

relMasterSlave = New DataRelation("masterslave", parentCol, childCol)

DataSet11.Relations.Add(relMasterSlave)

 

 

SqlDataAdapter1.Fill(DataSet11)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...