473,387 Members | 1,771 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.

opening and validating XMLfile in one go ??

Hi,

when opening an Xml-file to I want to perform validation immediately but the following does not work :

DataSet m_dsProducts = new DataSet();
m_dsProducts.ReadXmlSchema("cu.xsd");
m_dsProducts.ReadXml("cu.xml", XmlReadMode.ReadSchema);

The file opens but no runtime error when i pass an non-valid xml-file.

How come ?
Thnx
Chris
************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
Nov 16 '05 #1
1 1131
> The file opens but no runtime error when i pass an non-valid xml-file.

Instead of passing in the XML file name, bind an instance of
XmlValidatingReader to the XML file, and pass that to
m_dsProducts.ReadXml().
--
Mickey Williams
Author, "Visual C# .NET Core Ref", MS Press
www.neudesic.com
www.servergeek.com
Nov 16 '05 #2

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

Similar topics

1
by: Martin Beering | last post by:
hi to all, I do have a really big problem. I am writing a xml-file with the following vb.net.code Dim xmlfile As String = "C:\Inetpub\wwwroot\Kostenrechnung\myXML.xml" .........
1
by: Niklas Lagergren | last post by:
Hi, I'll try to explain. I'm now using C# and I have an xmlfile that contains users and information about them, this xmlfile can be read and changed from many threads in my application, as many...
3
by: Flare | last post by:
H I have a dll lib wich contains a static method to read and return a result from a xmlfile. But is possible that this dll could be called at the same time from muliple threads. Is this a...
4
by: Mike P | last post by:
I have an XML file, which I want to write the screen (in its standard XML format) in my ASP.NET C# webpage. Can anybody tell me how to do this? *** Sent via Developersdex...
6
by: Alex Bink | last post by:
Hi, I have a validating event on a textbox in which I want to prevent the user to leave the textbox without entering the right data. Only if he clicks on another specific control he is allowed...
2
by: yburtin | last post by:
Hi, I'm currently working on a dotnet web application and here is the problem I have: On my computer (french version of xp pro), I have my webserver installed. Inside one of my webpages, I...
0
by: Joe | last post by:
Hi For a while now I have been finding postings of problems with the validating event not firing on controls properly. I too had this problem. The event would fire when clicking on another...
0
by: Gary Shell | last post by:
I am experiencing some strange behavior between a UserControl's validating event and a treeview control. Initially, I thought it was related to an issue in the Knowledgebase article 810852...
0
by: developing | last post by:
someone please help me do this...how to validate an xml file if the doctype is NOT specified! I have the DTD with me, but the I have to check XML files without the DOCTYPE or DTD I already have...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.