473,545 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

possible DataSet.ReadXml bug? or maybe just a user error ;)

Hopefully someone can point out what is going on here. I'll give a short
explanation first, then a more detailed one at the bottom if anyone wants to
dig into it more.

I have a strongly-typed dataset (from a .xsd file in my project) called
dsConfig.

When i make the following call:

dsConfig.ReadXm l("buttons.xml" , XmlReadMode.Aut o);

i get the following error:

An unhandled exception of type 'System.NullRef erenceException ' occurred
in Unknown Module.
Additional information: Object reference not set to an instance of an
object.

HOWEVER.

If i change my call to this:

System.IO.FileS tream fs = System.IO.File. OpenRead("butto ns.xml");
dsConfig.ReadXm l(fs, XmlReadMode.Aut o);

then it executes properly.

Any ideas? Its not that complicated to do that, but it obviously shouldn't
be that way. More details at the bottom.

Thanks in advance!

Tim

-------------------------------------------------------

OK, so here are the details

I have a usercontrol (we'll call it A). inside of A, there is a function
(we'll call it DoStuff()) that executes the above line of code (the original
one that i said didn't work).
if i have an instance of A in a form, then A.DoStuff() executes with no
problems.

I then have an inherited usercontrol (we'll call it B) that inherits from A.
if i have an instance of B in a form, then B.DoStuff() executes with no
problems.

I then have a separate usercontrol (we'll call it C) that contains an
instance of B. In C, there is a function (we'll call it DoMoreStuff()) that
calls B.DoStuff(). If i have an instance of C on my form, and i call
C.DoMoreStuff() , then i get the error i listed above, and i can fix it only
with the above hack. The error actually occurs all the way down in the code
for A if i include all the projects. in the solution and step all the way
down into it.

Any ideas?

Tim

Nov 15 '05 #1
1 3333
I have an update to my problem.

I checked to see what XmlReadMode the call to ReadXml(fs, XmlReadMode.Aut o)
was using (through the return value. It was using XmlReadMode.Ign oreSchema.

Now, if i use

dsConfig.ReadXm l("buttons.xml" , XmlReadMode.Ign oreSchema);

the line executes fine.

What gives? shouldn't Auto have been choosing this anyway? And even if it
wasn't, why wasn't this error occuring in the base class or the inherited
class, why just when i put the inherited class in a new control?

Thanks in advance,

Tim
Nov 15 '05 #2

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

Similar topics

5
385
by: DotNetJunkies User | last post by:
Hi all, I have a question on how can I write the entire Dataset to a NTEXT field of SQLServer. Can anyone help me? Thanks! /mike
1
5811
by: mr_dom_is | last post by:
Hi I have a little bit of trouble, probably missing the point now sure but: I have a dataset dim ds as new dataset("User") Which is populated with data from a database. When I use
0
1468
by: mr_dom_is | last post by:
Hi I have a little bit of trouble, probably missing the point not sure but: I have a dataset dim ds as new dataset("User") Which is populated with data from a database. When I use
22
25551
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to compile. <WebMethod()> _ Public Function VerifySku(ByVal skus As XmlDataDocument) As DataSet Test program : Dim cartSet As DataSet cartSet =...
11
3923
by: MurdockSE | last post by:
Greetings. My Situation: // I have an .xml file that I am reading into a dataset in the following code - DataSet ds = new DataSet("MyDataset"); ds.ReadXml(@"c:\data\"+cmyxmlfilename);
6
1501
by: samoore33 | last post by:
I have created a xml doc that stores dates. On the first of the year I want to upload the xml doc into a dataset and then loop through it adding one year to those dates. This is what I have attempted. myData.ReadXml("this.xml") myTable = myData.Tables("myInformation") myRow = myData.Tables("myInformation").Select(filterExp,
1
3621
by: Mac | last post by:
I'm trying to validate input from an xml source to a dataset in dotnet2.0. As far as I can see, type errors correctly cause an exception, but values that are the correct type but do not satisify xsd:restriction conditions are ingested without a murmur. Is this a bug or a feature? Very frustrating. Evidence: 1) XML data <?xml...
1
4993
by: GoogleGroups | last post by:
It seems like this should be easy, but it has proven to be quite painful. I have an existing dataset, which I used the GetChanges and WriteXML functions upon to write out a DiffGram to a local XML file. I want to use this same dataset (in another instance of the application) and the DiffGram to display the changes in the DataGridView as...
4
1994
by: Thiago Macedo | last post by:
Hi, I posted an issue on the .vb group that is related to the .Net Framework 2.0. Posting here for a larger abrangence: i'm developing a windows application that gets data from an Mysql database through PHP server-side scripts. I'm not totally familiar with Requests and XML on .Net 2.0. I'll load these sort of data - simply generated by...
0
7487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7420
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5349
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4966
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.