<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Code to get the Data Type for a Data Source</title><link>https://www.infopathdev.com:443/forums/thread/19606.aspx</link><pubDate>Sun, 06 May 2007 03:43:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:19606</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/19606.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=19606</wfw:commentRss><description>Hi mfrumer,
&lt;br /&gt;&lt;br /&gt;
If you have the node in the Data Source taskpane you can discover the dataType by just double-clicking and viewing the properties.  Am I missing something?</description></item><item><title>Code to get the Data Type for a Data Source</title><link>https://www.infopathdev.com:443/forums/thread/12929.aspx</link><pubDate>Fri, 11 Aug 2006 15:45:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12929</guid><dc:creator>mfrumer</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12929.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12929</wfw:commentRss><description>(This is a duplicate of a topic I accidentally posted on the Newbie forum.)&lt;br /&gt;&lt;br /&gt;Using VB.Net, how can I get Data Type of a Data Source.&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Dim nl As IXMLDOMNodeList&lt;br /&gt;Dim node As IXMLDOMNode&lt;br /&gt;Dim str As String&lt;br /&gt;Dim intCount As Integer&lt;br /&gt;nl = thisXDocument.DOM.selectNodes("/my:myFields/descendant::*")&lt;br /&gt;str = "'"&lt;br /&gt;intCount = 0&lt;br /&gt;Do While (True)&lt;br /&gt;' MsgBox("Doing: nl.nextNode")&lt;br /&gt;node = nl.nextNode()&lt;br /&gt;If (IsDBNull(node)) Then&lt;br /&gt;Exit Do&lt;br /&gt;End If&lt;br /&gt;intCount = intCount + 1&lt;br /&gt;&lt;br /&gt;'str += node.xml &lt;br /&gt;'str += node.text&lt;br /&gt;If (InStr(node.nodeName, "group") = 0) Then&lt;br /&gt;str = str &amp; node.nodeName &amp; _&lt;br /&gt;"-" &amp; node.nodeType &amp; _&lt;br /&gt;"-" &amp; node.nodeTypeString &amp; _&lt;br /&gt;"-" &amp; node.dataType &amp; _&lt;br /&gt;"-" &amp; node.nodeTypedValue &amp; _&lt;br /&gt;"-" &amp; node.text &amp; vbCrLf&lt;br /&gt;If (intCount &amp;gt; 50) Then&lt;br /&gt;Exit Do&lt;br /&gt;End If&lt;br /&gt;End If&lt;br /&gt;Loop&lt;br /&gt;&lt;br /&gt;'XDocument.DOM.selectSingleNode( "//my:field7" ).text = str;&lt;br /&gt;MsgBox(str)&lt;br /&gt;</description></item></channel></rss>