473,378 Members | 1,175 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,378 software developers and data experts.

.Net 2.0 => XmlReader returns "{None}"

Hi,
I'm quit confused with the following problem:
I'm tryin to read an Embedded Xml file from my Class Library using a
static method which should returns a XmlReader.

The point is that using DataSet or XmlDocument works perfectly... using
XmlReader always fails. I always get "None" as a result.

Even using XmlReaderSettings does not change anything.

*****
Assembly a = Assembly.GetExecutingAssembly();
Stream s = a.GetManifestResourceStream("MyFile.xml");
XmlReader rdr = XmlReader.Create(s);
*****

Any help would me most welcome.

Thks.

Aug 24 '06 #1
1 3435
I am having the exact same problem. I have tried several examples from the
web, and Create always returns "{None}".

Here is my code:

XmlReaderSettings settings = new XmlReaderSettings();
settings.ConformanceLevel = ConformanceLevel.Fragment;
settings.IgnoreWhitespace = true;
settings.IgnoreComments = true;
XmlReader reader = XmlReader.Create("C:\\BookParticipant.xml", settings);

The BookParticipant.xml file contains:
<BookParticipant
type="Author"><FirstName>Joe</FirstName><LastName>Rattz</LastName></BookParticipant>

One thing, I have the May LINQ CTP installed. I can't help but wonder if it
may be involved. Franck, do you have it installed?

Thanks.

"Franck" wrote:
Hi,
I'm quit confused with the following problem:
I'm tryin to read an Embedded Xml file from my Class Library using a
static method which should returns a XmlReader.

The point is that using DataSet or XmlDocument works perfectly... using
XmlReader always fails. I always get "None" as a result.

Even using XmlReaderSettings does not change anything.

*****
Assembly a = Assembly.GetExecutingAssembly();
Stream s = a.GetManifestResourceStream("MyFile.xml");
XmlReader rdr = XmlReader.Create(s);
*****

Any help would me most welcome.

Thks.

Sep 6 '06 #2

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

Similar topics

8
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP programming. I found something weird. Response.Write(Request("something")) It draws "None" when there's no value for something. Actually I expect "" instead of...
13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
5
by: Daniel Crespo | last post by:
Is there a built-in method for transforming (1,None,"Hello!") to 1,None,"Hello!"? Thanks
5
by: Sue | last post by:
Help! I have an asp table with an embedded table. The asp tablerow that contains this table has a static ID assigned of "FilterRow2" (see snippets of code below). When I click on the button to set...
5
by: z. f. | last post by:
sorry about the previous post, by mistake not completed. i have an asp.net page with the line <%@ OutputCache Duration="30" VaryByParam="none" %> but when i make requests to the page with...
2
by: YeeCN | last post by:
Hi, I have a page which contain a image control for displaying a .gif file. The application allows the user to upload a different image to replace the existing one - but when I do...
2
by: Nathan Sokalski | last post by:
I have several DropDownList controls on my page that use databinding. However, I want to give users the option of selecting a choice such as "None Selected" or something else that shows they did...
2
by: spifster | last post by:
Hello all, I am building a collapsable tree using Javascript with DOM in IE. In order to make collapsed cells disappear I have been hiding the text. The cells collapse but still leave borders...
2
by: Good Man | last post by:
Hi there I have quite a bit of experience with CSS but I am stumped by the following: http://www.electricphase.com/example/example1.php (uses http://www.electricphase.com/example/test1.css) ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.