I tried doing a table count but could get it to work.I did this instead, it
works although I am sure you could something with less lines of code.
Function nodecount() As Integer
xmldoc = Session("xmldoc")
Dim intnodecount As Integer = 0
xmllist = xmldoc.GetElementsByTagName("formelement")
For Each xmlnode In xmllist
intnodecount = intnodecount + 1
Next
If intnodecount = 0 Then
lbltest.Text = "XML Config File is empty"
End If
Return intnodecount
End Function
"intrader" <in******@attglobal.net> wrote in message
news:pa****************************@attglobal.net. ..
On Fri, 01 Jul 2005 10:13:40 -0700, Chris Kennedy wrote:
Could you give us a pointer in code as I am al ittle new to XML. Would a
node list in Xpath do the job?
"JV" <jo**********@goisc.com> wrote in message
news:u8*************@TK2MSFTNGP15.phx.gbl... You could preload it using XmlDocument and see if it has the nodes you
are expecting.
"Chris Kennedy" <ck**************@bleyonder.co.uk> I have a drop down
list, which binds to dataset based on an XML file like the one below.
The databind routine can't find any columns and hence throws an error.
Is there a straight forward way to test for this an then not bind?
My approach - you say that you already have a DataSet from the XML (via
ReadXML() method). Look in the properties of the DataSet (for example
Tables gives you the tables collection); from this you can infer whether
dataset is empty and prevent the Bind.