Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Nested table 'link' which inherits its namespace cannot have multiple

Status
Not open for further replies.

Jackxxx

Programmer
Jun 21, 2007
31
US
Does anyone know what I need to do to get past this error?

The error is "Nested table 'link' which inherits its namespace cannot have multiple parent tables in different namespaces."

I get the error on this line:

dscte.ReadXml(xtr)


view plaincopy to clipboardprint?
01.Protected Sub lstOpens_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
02. Dim ConnectStr As String = _
03. ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
04.
05. 'Try
06. Dim ctu As String = GetCTU()
07. Dim ctp As String = GetCTP()
08. 'check if user has ct's
09. If String.IsNullOrEmpty(ctu) Then
10. Exit Sub
11. End If
12. If String.IsNullOrEmpty(ctp) Then
13. Exit Sub
14. End If
15.
16. 'this returns an xml info for selected Campaign (email)
17.
18. Dim sUri As String = " & Me.lstOpens.SelectedValue.ToString()
19. Dim sAPIKey As String = "/////"
20.
21. 'setup httpWebReqeust to send the request
22. Dim address As New Uri(sUri)
23. Dim theRequest As HttpWebRequest = TryCast(WebRequest.Create(address), HttpWebRequest)
24. theRequest.Credentials = New NetworkCredential((sAPIKey & "%" & ctu), ctp)
25.
26. theRequest.Method = "GET"
27. theRequest.ContentType = "application/vnd.ctct+xml"
28.
29. Using theResponse As HttpWebResponse = TryCast(theRequest.GetResponse(), HttpWebResponse)
30. 'load dataset with xml response
31. Dim xtr As New XmlTextReader(theResponse.GetResponseStream())
32. xtr.ReadString()
33. Dim dscte As New DataSet()
34. dscte.ReadXml(xtr)
35.
36. 'Create the xml file to check what we are receiving.
37. dscte.WriteXml("C:\Documents\Data.xml")
38. End Using
39. 'Catch ex As Exception
40. ' HttpContext.Current.Response.Write(ex.Message)
41. 'End Try
42. End Sub
Protected Sub lstOpens_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ConnectStr As String = _
ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString

'Try
Dim ctu As String = GetCTU()
Dim ctp As String = GetCTP()
'check if user has ct's
If String.IsNullOrEmpty(ctu) Then
Exit Sub
End If
If String.IsNullOrEmpty(ctp) Then
Exit Sub
End If

'this returns an xml info for selected Campaign (email)

Dim sUri As String = " & Me.lstOpens.SelectedValue.ToString()
Dim sAPIKey As String = "/////"

'setup httpWebReqeust to send the request
Dim address As New Uri(sUri)
Dim theRequest As HttpWebRequest = TryCast(WebRequest.Create(address), HttpWebRequest)
theRequest.Credentials = New NetworkCredential((sAPIKey & "%" & ctu), ctp)

theRequest.Method = "GET"
theRequest.ContentType = "application/vnd.ctct+xml"

Using theResponse As HttpWebResponse = TryCast(theRequest.GetResponse(), HttpWebResponse)
'load dataset with xml response
Dim xtr As New XmlTextReader(theResponse.GetResponseStream())
xtr.ReadString()
Dim dscte As New DataSet()
dscte.ReadXml(xtr)

'Create the xml file to check what we are receiving.
dscte.WriteXml("C:\Documents\Data.xml")
End Using
'Catch ex As Exception
' HttpContext.Current.Response.Write(ex.Message)
'End Try
End Sub
 
Can anyone shead any light on the meaning of this error?

Nested table 'link' which inherits its namespace cannot have multiple parent tables in different namespaces.
 
I have no idea what this error is, but my guess would be, that since the error is raised when the XML file is being read, that the XML is not well formatted. I would use an online XML validator to first check that the XML you are getting is well structured.
 
Is it possible to use the online validator in my code? Is there another way to get the xml from the response? I have only used datasets to read the xml response.

Thank you,
 
Is it possible to use the online validator in my code?
I doubt it unless they offer an api that you can call. If they do, you would most likely have to pay for that.
Is there another way to get the xml from the response?
I don't think so.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top