473,592 Members | 2,921 Online
Bytes | Software Development & Data Engineering Community
+ 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,XmlRead Mode.InferSchem a );
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.FormatEx ception: Input string was not in a correct format.
at System.Number.P arseInt32(Strin g s, NumberStyles style, NumberFormatInf o info)
at System.Int32.Pa rse(String s, NumberStyles style, IFormatProvider provider)
at System.Xml.XmlC onvert.ToInt32( String s)
at System.Data.Com mon.Int32Storag e.ConvertXmlToO bject(String s)
at System.Data.Dat aColumn.Convert XmlToObject(Str ing s)
at System.Data.Xml DataLoader.SetR owValueFromXmlT ext(DataRow row, DataColumn col, String xmlText)
at System.Data.Xml DataLoader.Load RowData(DataRow row, XmlElement rowElement)
at System.Data.Xml DataLoader.Load Rows(DataRow parentRow, XmlNode parentElement) at System.Data.Xml DataLoader.Load Rows(DataRow parentRow, XmlNode parentElement)
at System.Data.Xml DataLoader.Load Data(XmlDocumen t xdoc)
at System.Data.Dat aSet.ReadXml(Xm lReader reader, XmlReadMode mode, Boolean denyResolving)
at System.Data.Dat aSet.ReadXml(St ring fileName, XmlReadMode mode)
at Mod.OLSapRefres h.BLSAPBase.Ins ert() in c:\\vss\\sapref resh\\olsaprefr esh\\blsapbase. cs:line 62

The DataSet.HasErro rs 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(DataTab le myTable in this.Tables)
{
foreach(DataRow myRow in myTable.Rows)
{
if(myRow.HasErr ors)
{
Console.WriteLi ne(myRow.RowErr or);
}

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 1528

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

Similar topics

8
5716
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 in Excel, the multiple values which are separated by the 'comma' in the dataset are being displayed in the next column , which I dont want that way. I want to retain any commas which are present in my dataset. How do I handle such a scenario? ...
10
4007
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 inspection and behavior in the gri the data type is string. If I preview the dataset with the GUI in VISSTUDIO it shows my datatype to be dateTime .. If I try to rest the datatype I get this erro Additional information: Cannot change DataType...
1
1772
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
2026
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 want to create a page that will display a title and date of each newsletter, along with a link to it. here's a code snip: ============================= DirectoryInfo dirInfo = new DirectoryInfo(Server.MapPath("/newsletters/xml/"));
4
1301
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
23749
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 DataSetForXML.ReadXml(XMLDataToString) but I received error messages. Does anyone know how to do this without creating a file (disk copy) of this XML data? Thanks for your help. Marc
4
3595
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 sp's output will look something similar to this: <table1 column11="value111" column12="value112" column13="value113" /> <table1 column12="value121" column2="value122" column3="value123" /> <table2 column21="value211" column2="value212"...
3
2261
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 table is a XMLDoc. So I have the XML in a XMLDoc and I need to create a table in the dataset which would read xml from the XMLDoc . So in essence I need something like
9
2939
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 try to serialize/deserialize dataset schema, I get the error below during deserialization: "System.ArgumentException: The DefaultValue for column TestEnumField is of
0
7871
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8236
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7995
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8227
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6642
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5400
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1467
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.