(This is a duplicate of a topic I accidentally posted on the Newbie forum.)
Using VB.Net, how can I get Data Type of a Data Source.
It looks like I can do it with the code below, which I adapted from a post on this forum. But for data types other than "string" (boolean, date, etc.), the "node.datatype" returns a null.
Dim nl As IXMLDOMNodeList
Dim node As IXMLDOMNode
Dim str As String
Dim intCount As Integer
nl = thisXDocument.DOM.selectNodes("/my:myFields/descendant::*")
str = "'"
intCount = 0
Do While (True)
' MsgBox("Doing: nl.nextNode")
node = nl.nextNode()
If (IsDBNull(node)) Then
Exit Do
End If
intCount = intCount + 1
'str += node.xml
'str += node.text
If (InStr(node.nodeName, "group") = 0) Then
str = str & node.nodeName & _
"-" & node.nodeType & _
"-" & node.nodeTypeString & _
"-" & node.dataType & _
"-" & node.nodeTypedValue & _
"-" & node.text & vbCrLf
If (intCount > 50) Then
Exit Do
End If
End If
Loop
'XDocument.DOM.selectSingleNode( "//my:field7" ).text = str;
MsgBox(str)