Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: System.FormatException when you run a Visual Studio 2010 application that calls the DataSet.ReadXmlSchema method


View products that this article applies to.

Symptoms

Consider the following scenario:
  • You run an application that is created by using Microsoft Visual Studio 2010.
  • You call the DataSet.ReadXmlSchema method to read an XML schema into a DataSet object.
  • You set the Negative sign symbol setting to a symbol other than the minus sign ("-") in the Number tab of the Customize Format dialog box.

    Note The Customize Format dialog box is in the Regional and Language settings of the computer.
In this scenario, the application encounters a System.FormatException exception and then crashes. Additionally, you may receive the following error message and stack trace information if you try to debug the application:
Input string was not in a correct format.

StackTrace:

at System.Number.StringToNumber()

at System.Number.ParseInt32()

at System.String.System.IConvertible.ToInt32()

at System.Convert.ChangeType()

at System.Data.XSDSchema.HandleElementColumn()

at System.Data.XSDSchema.HandleParticle()

at System.Data.XSDSchema.HandleComplexType()

at System.Data.XSDSchema.InstantiateTable()

at System.Data.XSDSchema.HandleTable()

at System.Data.XSDSchema.LoadSchema()

at System.Data.DataSet.InferSchema()

at System.Data.DataSet.ReadXmlSchema()

at System.Data.DataSet.ReadXmlSchema()

at WindowsFormsApplication2.Form1.button1_Click()

↑ Back to the top


Cause

This issue occurs because of a hardcoded literal "-1" string in the XSDSchema.HandleElementColumn method.

↑ Back to the top


Resolution

Hotfix information


A supported hotfix is now available from Microsoft. However, it is intended to correct only the problem that is described in this article. Apply it only to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.



To resolve this problem immediately, contact Microsoft Customer Support Services to obtain the hotfix. For a complete list of Microsoft Customer Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:
Note
In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

Prerequisites


To apply this hotfix, you must have Visual Studio 2010 installed.

Restart requirement

  You must restart the computer after you apply this hotfix if the affected file is being used.  

  We recommended that you close all instances of Visual Studio before you apply this hotfix.  

Hotfix replacement information

  This hotfix does not replace a previously released hotfix.  

File Information


The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the
Time Zone
tab in the
Date and Time
item in Control Panel.


For the x86-based version of Windows XP and of Windows Server 2003
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.56532,927,61611-Feb-201103:32x86
For the x64-based version of Windows XP and of Windows Server 2003
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.56533,095,55210-Feb-201121:15x64
System.data.dll2.0.50727.56532,927,61611-Feb-201103:32x86
For the IA-64-based version of Windows XP and of Windows Server 2003
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.56533,234,81610-Feb-201121:56IA-64
System.data.dll2.0.50727.56532,927,61611-Feb-201103:32x86
For the x86-based version of Windows 7
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.56532,927,61617-Feb- 201123:34x86
For the x64-based version of Windows 7 and of Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.56533,095,55217-Feb- 201123:32x64
For the IA-64-based version of Windows Server 2008 R2
File nameFile versionFile sizeDateTimePlatform
System.data.dll2.0.50727.56533,234,81617-Feb- 201123:25IA-64

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

↑ Back to the top


Keywords: kbqfe, kbhotfixserver, kbfix, atdownload, kbhotfixdev, kbsurveynew, kb

↑ Back to the top

Article Info
Article ID : 2481091
Revision : 1
Created on : 1/7/2017
Published on : 4/6/2011
Exists online : False
Views : 266