DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 14 Aug 2007 14:36:00 -0700,    posted on: microsoft.public.dotnet.xml        back       

Thread Index
  1    mrcsharpman


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;
--------------------------------------
Date:Tue, 14 Aug 2007 14:36:00 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us