469,623 Members | 968 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

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 1305

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by dSchwartz | last post: by
4 posts views Thread by Shapper | last post: by
12 posts views Thread by Marc | last post: by
4 posts views Thread by J.C.Rivera | last post: by
3 posts views Thread by P K | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.