XmlDataDocument from DataSet with Nested DataRelations

G

Guest

I have a DataSet with 3 tables, and two DataRelations

dsSubs.Tables[0].TableName = "Subscriptions"
dsSubs.Tables[1].TableName = "AccountManagers"
dsSubs.Relations.Add
"AccountManagers_Subscriptions",
dsSubs.Tables["AccountManagers"].Columns["UserId"]
dsSubs.Tables["Subscriptions"].Columns["UserId"])

dsSubs.Tables[2].TableName = "NewsFeeds"
dsSubs.Relations.Add
"Subscriptions_NewsFeeds"
dsSubs.Tables["Subscriptions"].Columns["SubscriptionId"]
dsSubs.Tables["NewsFeeds"].Columns["SubscriptionId"])

I marked the two DataRelations as Nested, by doing the following

dsSubs.Relations["AccountManagers_Subscriptions"].Nested = true
dsSubs.Relations["Subscriptions_NewsFeeds"].Nested = true

This greatly improves the performance of XSL Transformations.

However, when I try to create an XmlDataDocument from the DataSet like this

XmlDataDocument oDoc = new XmlDataDocument(dsSubs)

I get the Object reference not set to an instance of an object. erro

If I comment out the lines which define the DataRelations as Nested, this doesn't occur

Anyone know why this is occuring
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top