E
Earl
How do I read in a type from XML? I can successfully write the value out to
the file as a type, but I cannot read it back in. Here is partial code for
the save portion:
Private NT As Type = GetType(NetworkType)
Private m_PubNetworkType As NetworkType
............
Dim dcPubNetworkType As DataColumn = dt.Columns.Add("PublisherNetworkType",
NT)
drNew("PublisherNetworkType") = m_PubNetworkType
Here is partial code for the retrieval portion. This would seem to cast the
input field to a type, but when I pull the file in, I get a NullReference
exception (despite the fact that the field IS populated in the XML file).
m_PubNetworkType =
CType(dsIn.Tables("ReplicationSettings").Rows(0)("PublisherNetworkType"),
NetworkType)
Here is the written schema:
<xs:element name="PublisherNetworkType"
msdata
ataType="System.Data.SqlServerCe.NetworkType" type="xs:string"
minOccurs="0" />
Here is the written XML:
<PublisherNetworkType>DefaultNetwork</PublisherNetworkType>
the file as a type, but I cannot read it back in. Here is partial code for
the save portion:
Private NT As Type = GetType(NetworkType)
Private m_PubNetworkType As NetworkType
............
Dim dcPubNetworkType As DataColumn = dt.Columns.Add("PublisherNetworkType",
NT)
drNew("PublisherNetworkType") = m_PubNetworkType
Here is partial code for the retrieval portion. This would seem to cast the
input field to a type, but when I pull the file in, I get a NullReference
exception (despite the fact that the field IS populated in the XML file).
m_PubNetworkType =
CType(dsIn.Tables("ReplicationSettings").Rows(0)("PublisherNetworkType"),
NetworkType)
Here is the written schema:
<xs:element name="PublisherNetworkType"
msdata

minOccurs="0" />
Here is the written XML:
<PublisherNetworkType>DefaultNetwork</PublisherNetworkType>