473,320 Members | 1,896 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Reading in a type from an XML file

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:DataType="System.Data.SqlServerCe.NetworkTy pe" type="xs:string"
minOccurs="0" />

Here is the written XML:
<PublisherNetworkType>DefaultNetwork</PublisherNetworkType>

Nov 21 '05 #1
4 892
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:

You mean this one
http://msdn.microsoft.com/library/de...atypetopic.asp

Tell next time that it is a XML dataset file. There are more types for XML
files by instance documents.

I hope this helps,

Cor
Nov 21 '05 #2
That is the general idea, unfortunately, NetworkType and SecurityType are
not System types and apparently cannot be assigned in that fashion. Thus my
question.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uq**************@TK2MSFTNGP09.phx.gbl...
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:

You mean this one
http://msdn.microsoft.com/library/de...atypetopic.asp

Tell next time that it is a XML dataset file. There are more types for XML
files by instance documents.

I hope this helps,

Cor

Nov 21 '05 #3
Earl,
That is the general idea, unfortunately, NetworkType and SecurityType are
not System types and apparently cannot be assigned in that fashion. Thus
my question.

In my ideas are it in your sample just column (item) names, therefore I
don't understand why you cannot get the type with the sample I gave you. It
can of course be nothing when there is no schema where it is set. (The last
not tested).

Cor
Nov 21 '05 #4
The "sample you gave me" is the standard MSDN sample, and only allows
standard System types and no others.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uW****************@tk2msftngp13.phx.gbl...
Earl,
That is the general idea, unfortunately, NetworkType and SecurityType are
not System types and apparently cannot be assigned in that fashion. Thus
my question.

In my ideas are it in your sample just column (item) names, therefore I
don't understand why you cannot get the type with the sample I gave you.
It can of course be nothing when there is no schema where it is set. (The
last not tested).

Cor

Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: John | last post by:
I have over 5000 thumbnail pictures of size 5kb each. I would like to able to load all 5000 pictures and view 50 per page using mysql_data_seek(). I would like to know what are the advantages and...
4
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # to open a file and write to file # do f=open('xfile.txt','w') # this creates a file "object" and name it f. # the second argument of open can be
1
by: Sami | last post by:
Hello, I have this problem that I need your help with : I am reading a config file that contain the following : 2004 update
0
by: Eric Lilja | last post by:
Hello, I have a text file that contains a number of entries describing a recipe. Each entry consists of a number of strings. Here's an example file with only one entry (recipe): Name=Maple Quill...
3
by: Carl Lindmark | last post by:
*Cross-posting from microsoft.public.dotnet.languages.csharp, since I believe the question is better suited in this XML group* Hello all, I'm having some problems understanding all the ins and...
1
by: mail2atulmehta | last post by:
Hi, I do not know if this is right place for this, but i need some help. I have a text file, whose values are seprated by a delimiter. I want to open this file in excel, ( not import it) . I have...
4
by: Ganesh Muthuvelu | last post by:
Hi STAN, Stan: Thanks for your response to my previous post on reading a XSD file using your article in "https://blogs.msdn.com/stan_kitsis/archive/2005/08/06/448572.aspx". it works quite well...
1
by: hzgt9b | last post by:
(FYI, using VB .NET 2003) Can someone help me with this... I'm trying to read in an XML file... it appears to work in that the DataSet ReadXML method dose not fail and then I am able to access the...
6
by: efrenba | last post by:
Hi, I came from delphi world and now I'm doing my first steps in C++. I'm using C++builder because its ide is like delphi although I'm trying to avoid the vcl. I need to insert new features...
1
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.