The DataSet schema that is generated by the SqlDataAdapter control does not change when you change the SELECT query in Visual Studio 2005 (912604)
The information in this article applies to:
- Microsoft Visual Studio 2005 Professional Edition
- Microsoft Visual Studio .NET (2003), Professional Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
SYMPTOMSConsider the following scenario. You upgrade a project from Microsoft Visual Studio .NET 2003 to Microsoft Visual Studio 2005. This project contains the SqlDataAdapter control. In the SqlDataAdapter control, you change the SELECT query. In this scenario, the DataSet schema that is generated by the SqlDataAdapter control does not change.CAUSEThis behavior occurs in Visual Studio 2005 because the DataSet schema that is returned by the changed SELECT query is merged with the DataSet schema that is returned by the initial query. The new columns are added to the existing DataSet schema.
This behavior differs from the behavior in Visual Studio .NET 2003. In Visual Studio .NET 2003, the DataSet schema that is returned by the changed SELECT query replaces the DataSet schema that is returned by the initial query.WORKAROUNDTo work around this behavior, use one of the following methods: - Delete the DataSet schema, and then add a new DataSet schema. To do this, follow these steps:
- Create a new DataSet schema that has all the required tables.
- Delete the old DataSet schema.
- Rename the new DataSet schema to the name of the old DataSet schema.
- Delete the unnecessary columns from the DataSet schema. After you rebuild the project, the DataSet schema is updated.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 4/14/2006 |
---|
Keywords: | kbtshoot kbprb KB912604 kbAudITPRO kbAudDeveloper |
---|
|