473,499 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSet.ReadXml fails when a percentage (%) sign is in the filename followed by 2 hex characters

CB
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. So
c:\test%ab.xml fails for ReadXml since %ab is interpreted as 171 and
c:\test171.xml does not exist. There is no problem with c:\test%mn.xml
because "mn" is not a hex code. If I replace the % sign with %25
(25hex = 37dec = ascii code for %), the ReadXml function succeeds since
it is interpreted as c:\test%ab.xml. So I had to write a workaround
function to read a filename, replace any occurance of the % character
with %25, then call ReadXml. Yuk.

I found another related post that is about 2 years old that seems to be
using VB6 rather than C#
(http://groups.google.com/group/micro...3b2311783c011).
Is there some switch in the DataSet object to ignore %encoding in the
filename? %encoding is really only used in web dev rather than windows
dev anyway right? Is there a more appropriate workaround?

Nov 12 '05 #1
1 2087
CB
CORRECTION:
"So c:\test%ab.xml fails for ReadXml since %ab is interpreted as 171
and c:\test«.xml does not exist.". (%ab hex = 171 dec = ascii code
for «)

Nov 12 '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
2
1548
by: binvij | last post by:
Hi Guys ! I want your views on this An xml file can be loaded into a dataset in the following ways: XmlTextReader reader = new XmlTextReader("inrss.xml"); DataSet ds = new DataSet();...
8
5669
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...
4
3736
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
1
1764
by: Scott M. Lyon | last post by:
Part of an application I'm working on needs to manipulate some XML data (in an XML file), by reading the data into a DataSet using the MyDataSet.ReadXML method, and then using MyDataSet.WriteXML to...
0
1513
by: Leeor Chernov | last post by:
Hi , I am using the method: DSSap.ReadXml( XmlPath,XmlReadMode.InferSchema ); And as I expected I get an error when the xml does not matching my DataSet that contains already a schema , The...
1
2363
by: ray well | last post by:
i saved the state of a data set and table via MyDs.WriteXmlSchema("MyDs.xsd") MyDs.WriteXml("MyDs.xml") i was able to read them back in and display the info in the database by ...
4
3222
by: David | last post by:
Hi, (Sorry for duplicate post, finger trouble before I finished...) using C# 1.1 I am writing a winform app that collects a dataset from a webservice. At the same time I collect the data,...
6
1716
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
When I check the syntax of dataset, It seems that dataset can only read data from file. (e.g., datset.read(string filename), dataset.readxml(string filename)). If I have a string with XML format...
0
7131
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
7007
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...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4919
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...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
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...

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.