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

ReadXml fails please help

Hello NG,

I am using a typed DataSet, created with VS dataset designer.
I have the problem , that a table in the dataset refuses to read a xml file.
The strange thing is that if I create a seperate datatable, using the Typed
DataSet.Table this reads the xml file without any problems:

To make it a little more clear:
public class MyClass
{
....
DsMyDataSet myDataSet; // gets initalized in the constructor

....... some when at runtime this method is called ....
void MyReadFromFile(fileName)
{
myDataSet.myTable.ReadXml(fileName); // fails to read the xml
fail, table has 0 columns
DsMyDataSet.myTableTable tbl = new DsMyDataSet.myTableTable tbl();
tbl.ReadXml(fileName); // works fine, that table holds a bunch of
rows.
}
}

PLEASE HELP. What is it that I am doing wrong?

Regards
Rainer Queck
Jan 2 '08 #1
1 1325

I would start by removing any constraints .. like "primary key"
ones....while you're in the dataset designer.

And when you find the magic constraint that is killing you..you can figure
out your plan of attack for it.

This is a total guess.....please look at others who post ideas as well.


"Rainer Queck" <Ra**********@nomail.nomail.comwrote in message
news:O2**************@TK2MSFTNGP05.phx.gbl...
Hello NG,

I am using a typed DataSet, created with VS dataset designer.
I have the problem , that a table in the dataset refuses to read a xml
file.
The strange thing is that if I create a seperate datatable, using the
Typed DataSet.Table this reads the xml file without any problems:

To make it a little more clear:
public class MyClass
{
....
DsMyDataSet myDataSet; // gets initalized in the constructor

....... some when at runtime this method is called ....
void MyReadFromFile(fileName)
{
myDataSet.myTable.ReadXml(fileName); // fails to read the xml
fail, table has 0 columns
DsMyDataSet.myTableTable tbl = new DsMyDataSet.myTableTable tbl();
tbl.ReadXml(fileName); // works fine, that table holds a bunch of
rows.
}
}

PLEASE HELP. What is it that I am doing wrong?

Regards
Rainer Queck

Jan 2 '08 #2

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

Similar topics

11
by: DraguVaso | last post by:
Hi, I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the...
1
by: Steiner Hubert | last post by:
hello, i use this code: Dim ds As New DataSet ds.ReadXml(Me.txtImportFile.Text) at the readxml line i have the following error: "FormatException" please help
8
by: Nikhilesh Mehendale | last post by:
I have written a web service in C#, .NET 1.1 which reads a XML file into a dataset. This is just a plain XML file. First I use the Dataset.ReadXmlScheme function and pass the XML file to it. Then...
1
by: CB | last post by:
Using C# in .Net 2003, DataSet.ReadXml fails when a percentage (%) sign is in the filename followed by 2 hex characters. Seems that the % sign is likely encoding the following 2 hex characters. ...
5
by: James Morton | last post by:
I have a Static DataSet in a class file that I am using globally between a few forms. The main form populates the dataset through a menu option which invokes ReadXML in the class file to populate...
3
by: Raj Chudasama | last post by:
I am trying to read an xml file and have it view data in the datagrid. (For example take the xml file viewer in the visual studio, when u open an xml file it has that nice readable grid). I...
2
by: Jason Huang | last post by:
Hi, In my C# Windows Form project, I'm testing comparing using the SqlClient with the ReadXML method. The ReadXML method will read 2 .xml files, one is 4K, the other one is 3Mb, both are on my...
5
by: Hans Munich | last post by:
Szenario: User selects a XML File ("products.xml") to import newest Data. Data should replace Data in an existing Acess File which is connected via Dataadapter (daadaptFLR). Bevore the Existing...
1
by: BlouHond | last post by:
Hi, I'm using VB.net 2005. My dataset is called DsDetails1 My XML file is called details.xml When I use ReadXML, is there any way that I can set the path of this XML file to be read to be the...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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,...
0
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...
0
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,...
0
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...

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.