By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,417 Members | 1,825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,417 IT Pros & Developers. It's quick & easy.

XmlDataDocument from DataSet with Nested DataRelations

P: n/a
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

Nov 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.