This is a 2 part question:
Part 1:
I am accesing a web service that returns an xml string of user information. I am attempting to load the XML into an XMLDocument, save the document, load it into a dataset, and bind the dataset to a gridview.
I'm not sure if it's neccesary to save the XML file to disk, but I wanted to make sure it was well formed. It is.
No exceptions are caught during the loading and binding process, but my gridview only displays the first 2 attribute values of the parent node (the first datarow). Any ideas as to why this would happen?
Part 2:
I need to filter the data based on several attribute values in the XML file. Is this more efficient pre-dataset or post-dataset? At a high-level, how would one go about doing either?
Here is the code:
Private Sub GetMembers()
Dim tSessionId As String = Session("TimssSessionId").ToString
Dim wsTimssCustomer As New wsTimssCustomer.TIMSSCustomer
Dim xmlDocMembers As New XmlDocument
Dim oDataSet As DataSet
Dim sXMLMembersFile As String = Server.MapPath("xmldocuments/members.xml")
'Open a new call to the web service thru the web reference
Dim wsTimssCusGet As wsTimssCustomer.TIMSSCustomer = New wsTimssCustomer.TIMSSCustomer()
'Use the GetCustomers Web Service passing session id, field names, values
Dim MemberXml As String = wsTimssCusGet.GetCustomers(tSessionId, "FirstName, LastName", "Jason, Abney")
'Load the return in an XML Document
xmlDocMembers.LoadXml(MemberXml)
xmlDocMembers.Save(sXMLMembersFile)
Try
oDataSet = new DataSet
oDataSet.ReadXml(sXMLMembersFile)
'Bind it to the gridview
gvMembers.DataSource = oDataSet.Tables(0)
gvMembers.DataBind()
Catch ex As Exception
Response.Write(ex.ToString)
End Try
End Sub