473,473 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

WHen DataSet.ReadXml() , I want to have a specific column error

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 problem is that I get the following to-much detailed message:
System.FormatException: Input string was not in a correct format.
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Int32.Parse(String s, NumberStyles style, IFormatProvider provider)
at System.Xml.XmlConvert.ToInt32(String s)
at System.Data.Common.Int32Storage.ConvertXmlToObject (String s)
at System.Data.DataColumn.ConvertXmlToObject(String s)
at System.Data.XmlDataLoader.SetRowValueFromXmlText(D ataRow row, DataColumn col, String xmlText)
at System.Data.XmlDataLoader.LoadRowData(DataRow row, XmlElement rowElement)
at System.Data.XmlDataLoader.LoadRows(DataRow parentRow, XmlNode parentElement) at System.Data.XmlDataLoader.LoadRows(DataRow parentRow, XmlNode parentElement)
at System.Data.XmlDataLoader.LoadData(XmlDocument xdoc)
at System.Data.DataSet.ReadXml(XmlReader reader, XmlReadMode mode, Boolean denyResolving)
at System.Data.DataSet.ReadXml(String fileName, XmlReadMode mode)
at Mod.OLSapRefresh.BLSAPBase.Insert() in c:\\vss\\saprefresh\\olsaprefresh\\blsapbase.cs:li ne 62

The DataSet.HasErrors in the catch block is still false ,
and I cant use the fllowing code from msdn to find out the specific column or row:
if ( this.HasErrors == true )
{
foreach(DataTable myTable in this.Tables)
{
foreach(DataRow myRow in myTable.Rows)
{
if(myRow.HasErrors)
{
Console.WriteLine(myRow.RowError);
}

Since HasErrors = false.
Why HasErrors = false altough I have an error???
, And How can I get the specific Row and Column(specific) error???

TNX
Leeor Chernov
R&D ,
SPL Software

Jan 17 '06 #1
0 1508

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

Similar topics

8
by: Deepa | last post by:
I am writing a console app in c# wherein am converting a dataset into a CSV file. It works fine. But I have some values in the dataset which have a comma within(eg. A,B,C). When I view the CSV file...
10
by: andrewcw | last post by:
I read in a earlier post that I can get the column of a grid to sort by datetime if the column type was set as Date I deserialize my XML and one attribute of the XSD has type as dateTime but upon...
1
by: KJ | last post by:
I have an easy xml document, for example: <pics> <pic name="foo"/> <pic name="bar"/> </pics> I call ReadXML on my DataSet, and no problems (2 rows, one for each pic
2
by: dSchwartz | last post by:
I need help adding a column to a dataset, but its a little bit more complicated then just that. Here's the situation: I have many xml files in one directory, each which represent a newsletter. I...
4
by: Shapper | last post by:
Hello, I have a XML file that includes the node <item>: .... <title>...</title> <url>...</url> <item> <title>title 01</title> <description>description 01</description> </item>
12
by: Marc | last post by:
I have used XMLDataToString = DataSetForXML.GetXml() to get an XML string from a dataset. I am looking for a way to create a dataset from this XML string. I tried...
4
by: J.C.Rivera | last post by:
Hello... I'm a rookie to c#. So let me see if i can expose properly my situation. I developed a stored procedure in sql server 2000 that allows me to construct my dataset in XML format. the...
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...
9
by: PeterWellington | last post by:
I have a column in a data table that stores enum values and assigns a default value: Dim dc As New DataColumn("TestEnumField", GetType(DayOfWeek)) dc.DefaultValue = DayOfWeek.Thursday When I...
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
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...
1
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...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
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.