"Type 'DataSetName' is not defined" error message when you build the project (816801)
The information in this article applies to:
- Microsoft ADO.Net 2.0
- Microsoft ADO.NET (included with the .NET Framework 1.1)
- Microsoft ADO.NET (included with the .NET Framework) 1.0
- Microsoft Visual C# 2005, Express Edition
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
SYMPTOMSWhen you create a DataSet during design time by using the Generate DataSet option of a DataAdapter, an instance of the DataSet is
automatically created on the form. When you modify the name of the DataSet in
the Properties window, save the project, and then try to open the form, you may
receive the following error message on the form: An error
occurred while loading the document. Fix the error, and then try loading the
document again. The error message follows: Unspecified error When
you build your project, you may receive the following error
message: Type 'ApplicationName.OldDataSetName' is not
defined. CAUSE The problem occurs because when the DataSet name is changed
in the DataSet schema file (.xsd), Microsoft Visual Studio 2005 or Microsoft Visual Studio .NET does not modify
the DataSet name in the InitializeComponent of the form where the DataSet is initialized. RESOLUTIONTo resolve this problem, replace the DataSet name with the
new name in the code. To do this, follow these steps:
- On the View menu, click
Code.
- In the code, replace each instance of the Dataset name from
DataSet1 to MyDataSet.
- Save the project, and then in Solution Explorer,
double-click Form1.cs.
STATUS This
behavior is by design.REFERENCESFor more information, visit the following Microsoft
Developer Network (MSDN) Web sites:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbprb kbcode kberrmsg kbSystemData kbWindowsForms kbtable kbSqlClient kbSchema kbDesigner kbDatabase kbDataAdapter KB816801 kbAudDeveloper |
---|
|