BUG: The targetNamespace property of DataSet instances is hard-coded in Windows Form constructor (316839)
The information in this article applies to:
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft XML Classes (included with the .NET Framework 1.0)
This article was previously published under Q316839 SYMPTOMS When you generate a DataSet object from an XSD schema file and then add the DataSet to a Windows Form, the targetNamespace property of the schema file on which the DataSet is based is hard-coded in the "InitComponent" section of the
Form. For example, in Visual C# .NET, you can see the following within the private void InitializeComponent() call:
this.dataset11.DataSetName = "Dataset1";
this.dataset11.Locale = new System.Globalization.CultureInfo("en-US");
//namespace http://schema.microsoft.com/MyDataset1 is hard-coded
this.dataset11.Namespace = "http://schema.microsoft.com/MyDataset1";
If the targetNamespace in the DataSet schema is changed for any reason, a few scenarios may stop
working; for example, writing the DataSet out to an XML file, reading it back in, and persisting the DataSet with the correct namespace. CAUSE If you change the namespace of an XSD schema in the DataSet
Designer, new instances of the typed DataSet get the updated namespace, but the existing instance is not
changed automatically. RESOLUTION To work around the problem, manually change the namespace
in the "InitComponent" section of the Form, or delete and then read the typed DataSet after changing the namespace. STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 9/15/2005 |
---|
Keywords: | kbvs2002sp1sweep kbbug KB316839 |
---|
|