I have not had trouble with a single nested table, however when I add a
second level of nesting I get the same System.NullReferenceException
exception. Here is my stack. Notice that the childCol is null - perhaps the
problem.
system.data.dll!System.Xml.XmlDataDocument.OnNeste dParentChange(System.Data.DataRow
child = {System.Data.DataRow}, System.Xml.XmlBoundElement childElement =
{System.Xml.XmlBoundElement}, System.Data.DataColumn childCol = <undefined
value>) + 0xcc bytes
system.data.dll!System.Xml.XmlDataDocument.OnAddRo w(System.Data.DataRow
row = {System.Data.DataRow}) + 0x102 bytes
system.data.dll!System.Xml.XmlDataDocument.LoadTre eFromDataSet(System.Data.DataSet ds = {System.Data.DataSet}) + 0x14e bytes
system.data.dll!System.Xml.XmlDataDocument.Bind(bo ol fLoadFromDataSet =
true) + 0x6d bytes
system.data.dll!System.Xml.XmlDataDocument.Init(Sy stem.Data.DataSet ds =
{System.Data.DataSet}) + 0xa8 bytes
system.data.dll!System.Xml.XmlDataDocument.XmlData Document(System.Data.DataSet dataset = {System.Data.DataSet}) + 0x50 bytes
.... the rest is my user code ...
Microsoft: What are the conditions under which this exception will be thrown?
Thanks,
-Brad Schuler
MSDN Universal Subscriber
"James Ankrom" wrote:
Why does this fail?
Dim relResources As New Data.DataRelation("Application_Resources",
..Tables("User_Applications").Columns("Application _id"),
..Tables("Resource_Rights").Columns("Application_i d"), False)
mUserData.Relations.Add(relResources)
relResources.Nested = True
Dim UserDataXML As System.Xml.XmlDataDocument = New
System.Xml.XmlDataDocument(mUserData)
The last line fails with 'Object reference not set to an instance of an
Object' in onnestedparentchange.
Why can't I do this? This is almost exactly the code I find online - however
I have yet to see one example actually have all the complete code. I have,
however, found one post from someone who had this same problem but no
responses.
To answer the obvious questions -
Yes, I've googled the heck out of this problem to no avail.
Yes, the data is valid for relationships. Applying constraints is
successful and doesn't change anything.
The dataset contains four tables.
There's only one relationship between two of them (as listed above) and
no other relationships.
Any help is -greatly- appreciated.
Thanks!
Jim