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
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