473,400 Members | 2,145 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,400 software developers and data experts.

DataSet.ReadXml Method does not read/load space

Hello,

There is a space(as a data) in one of the columns. And i save my DataTable
as a xml file using DataSet. I used DataSet.WriteXml method to save as a xml
file. Now if I read that .xml file using DataSet.ReadXml method,it removes
space in that DataTable. Any idea...?
This does not work in Visual Studio .NET 2003. If I execute this in VS .Net
2005, it works. I must make it work in VS 2003.

Here there is a sample that does not work in VS NET 2003:
__________________________________________________ ______________________________

DataTable dbTable = new DataTable();
dbTable.Columns.Add(new DataColumn("MyColumn1",
Type.GetType("System.String")));

DataRow dbRow = dbTable.NewRow();
dbRow["MyColumn1"] = " ";
dbTable.Rows.Add(dbRow);

Console.WriteLine("Value = " + dbTable.Rows[0][0]);

DataSet dbSet = new DataSet();
dbSet.Tables.Add(dbTable);
dbSet.WriteXml("C:\\MyFile.xml", XmlWriteMode.WriteSchema);

dbRow = null;
dbTable = null;
dbSet = null;

DataSet dbReadSet = new DataSet();
dbReadSet.ReadXml("C:\\MyFile.xml", XmlReadMode.Auto);

Console.WriteLine("Value = " + dbReadSet.Tables[0].Rows[0][0]);

dbReadSet = null;
--------------------------------------

Aug 14 '07 #1
0 3262

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

Similar topics

0
by: MT | last post by:
I have an xsd file that I use to create a strongly typed dataset in my project. In the past, I have used the ReadXml method to load xml files into the generated class and read data in using this...
4
by: jaime | last post by:
1 I load a text file into a dataset, after doing a bit of work.. 2 Now I have a dataset full of data that I like to transfer to a data base 3 My problem is that if the rowstate of the row is set to...
11
by: Brian W. Smith | last post by:
I have XML Documents that I am digitally signing, and need to be able to load these documents into DataSet objects. However, after checking the signature and using the DataSet.ReadXML method, I am...
7
by: Sharon | last post by:
I have successfully loaded a DataSet object with a XML schema (XSD). Now I wish to populate the tables that was created in the DataSet. I have an XML file/string that contain all the needed data...
22
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...
3
by: P K | last post by:
Hello, I have a dataset which is already loaded with data in one table. so dataset.tables("data") exists and has data. Now, I have to add another table to the dataset. The source for this...
3
by: David P. Donahue | last post by:
I'm re-writing an application in C# that was originally written in Delphi 7. The heart of the application is a DataSet displayed in a DataGrid. One of the main functions of the previous...
11
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);
4
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...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.