PC Review


Reply
Thread Tools Rate Thread

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

 
 
Leeor Chernov
Guest
Posts: n/a
 
      17th Jan 2006
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(DataRow 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:line 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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: column expression fail in DataSet.ReadXml() Cor Ligthert Microsoft ADO .NET 0 12th Sep 2004 07:55 AM
RE: DataSet filled from ReadXML has missing column values... =?Utf-8?B?TWFyYyBKYWNvYnM=?= Microsoft ADO .NET 1 9th Jul 2004 12:10 AM
RE: DataSet filled from ReadXML has missing column values... =?Utf-8?B?TWFyYyBKYWNvYnM=?= Microsoft ADO .NET 0 8th Jul 2004 09:45 PM
RE: DataSet filled from ReadXML has missing column values... =?Utf-8?B?TWFyYyBKYWNvYnM=?= Microsoft ADO .NET 0 8th Jul 2004 09:45 PM
error in dataset.ReadXml()? Stephen Alpert Microsoft Dot NET Framework Forms 0 19th Sep 2003 02:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:02 AM.