Article ID: 313486 - Last Review: May 11, 2007 - Revision: 6.10 INFO: Roadmap for Visual Database Tools and Typed DataSetsThis article was previously published under Q313486 On This PageSUMMARY This article provides a roadmap to learn and to master the
Microsoft Visual Studio .NET Visual Database Tools and typed DataSet classes. Roadmap articles provide links to useful information, including online documentation, Microsoft Knowledge Base articles, and Microsoft white papers, to help you learn about a Microsoft product or technology. For additional information about ADO.NET technology roadmap articles, click the article number below to view the article in the Microsoft Knowledge Base: 313590
(http://support.microsoft.com/kb/313590/EN-US/
)
INFO: Roadmap for ADO.NET
For additional information about ADO.NET DataAdapter objects, click the article number below to view the article in
the Microsoft Knowledge Base:
313483
(http://support.microsoft.com/kb/313483/EN-US/
)
INFO: Roadmap for ADO.NET DataAdapter Objects
Visual Database ToolsYou can use the Visual Database Tools to do the following tasks:
There is some overlap and interaction between these two categories. For example, Server Explorer uses some editors, and you can drag a table from Server Explorer to a design surface to invoke code generators. The main components of Server Explorer are as follows: The other Visual Database Tools are as follows:
Server ExplorerWith Server Explorer, you can view database schema, edit SQL Server database schema, retrieve data interactively, and modify data interactively in the Visual Studio .NET integrated development environment (IDE).The connections are represented in a tree view. You can add connections to the Servers node or to the Data Connections node.
Server Explorer includes several editors for manipulating SQL Server. In the tree view, you can right-click the Data Connections node to create a new SQL Server database. You can right-click the Tables, the Views, the Stored Procedures, and the Database Diagrams nodes to create or to modify a table, a view, a stored procedure, or a database diagram respectively. You can also generate SQL script that you can run against a different server to re-create the database. Most of these functions, such as creating and modifying tables and stored procedures, are also available for Oracle databases. Database Designer You can use the Database Designer to edit database diagrams and create relationships by dragging fields from one table to another.
Database Designer
back to the list of tools
http://msdn.microsoft.com/en-us/library/ms171971.aspx (http://msdn.microsoft.com/en-us/library/ms171971.aspx) Table Designer You can use the Table Designer to create or to modify tables in the database. You can specify or modify field names, data types, constraints, and indexes, among other items. For more information about the Table Designer, visit the following Microsoft Web site:
Table Designer
back to the list of tools
http://msdn.microsoft.com/en-us/library/aa290301.aspx (http://msdn.microsoft.com/en-us/library/aa290301.aspx) Query and View Designer The Query and View Designer is shared by other data components, such as the Command and DataAdapter components. You can use the Query and View Designer to design queries visually and to view the results of the query. In Server Explorer, when you create or edit a view in the DataAdapter Configuration Wizard, or when you edit the CommandText property of a Command or a DataAdapter component, the Query and View Designer is invoked to generate the SQL statement for you. The SQL generating code only quotes identifiers for Microsoft SQL Server, Microsoft Jet, and Oracle. If you use a different back-end database, the identifiers will be unquoted. This may pose a problem if your database contains non-standard table or field names. For example, the names contain a space or other non-alphanumeric character. To correct this problem, you must manually make changes to the SQL in the generated code. However, if you regenerate the SQL, the changes will be lost. For more information about the Query and View Designer, visit the following Microsoft Web site:
Query and View Designer
back to the list of tools
http://msdn.microsoft.com/en-us/library/ms172013.aspx (http://msdn.microsoft.com/en-us/library/ms172013.aspx) SQL Editor The SQL Editor is invoked when you create a stored procedure. The SQL Editor provides color-coding to your T-SQL and PL/SQL statement and bounds individual statements with a rectangle for clarity. Additionally, when you edit multistatement SQL script, you can right-click individual statements and use the Query and View Designer to visually compose or edit these statements. For more information about the SQL Editor, visit the following Microsoft Web site:
SQL Editor
back to the list of tools
http://msdn.microsoft.com/en-us/library/ms172018.aspx (http://msdn.microsoft.com/en-us/library/ms172018.aspx) Other Visual Database ToolsThe tools that are listed in this section write code into your project. You can modify this code or write equivalent code. Some tools, such as the Data Form Wizard, generate a Windows Form class that includes DataAdapter components, a typed DataSet, and bound controls. Other tools, such as the Parameter Collection Editor, perform more limited tasks, such as editing the Parameters collection of a single Command.Data Form Wizard The Data Form Wizard is similar to the Form Wizard in Microsoft Access. With the Data Form Wizard, you can specify one or two tables on the server and then choose from a number of styles. The wizard then configures how the elements appear on the Windows Form. The Data Form Wizard does the following tasks:
Data Form Wizard
back to the list of tools
http://msdn2.microsoft.com/en-us/library/aa291437(VS.71).aspx (http://msdn2.microsoft.com/en-us/library/aa291437(VS.71).aspx) Advanced SQL Generation Options Dialog Box http://msdn.microsoft.com/en-us/library/2ft8f67x.aspx (http://msdn.microsoft.com/en-us/library/2ft8f67x.aspx) Data Form Wizard Generated Code http://msdn.microsoft.com/en-us/library/aa291843.aspx (http://msdn.microsoft.com/en-us/library/aa291843.aspx) XSD Editor You can use the XSD Editor to create and to edit an XML Schema Definition Language (XSD) schema file in your project. You can edit the XSD file as straight Extensible Markup Language (XML) or in a graphical editor that is similar to the Table Designer and Database Designer of Server Explorer. You can generate a typed DataSet from an XSD file by setting the Custom Tool property to MSDataSetGenerator. If you leave this property blank, the DataSet class file is no longer a part of the project and will be deleted from the disk. back to the list of tools XML Editor You can use the XML Editor to edit an XML file in your project. You can edit the XML through a text interface that supports color coding and tag completion or through a hierarchical, tabular editor. back to the list of tools Connection, Command, DataAdapter, DataSet, and DataView Components You can add these components from the Data tab of the toolbox, or you can use Server Explorer or the Data Form Wizard to add and to configure these components for you. You can use the typed DataSet component for design-time data binding. Occasionally, data binding can be a confusing. For example, in a Windows Form, the designer only allows you to bind simple controls one way to a data source, but you can bind a DataGrid control or the list of a ListBox control or a ComboBox control two different ways. One of these ways is incompatible with the way that simple controls are bound. By using a DataView component, you can make sure that all of your controls are consistently bound. You can open a number of builders from the properties of the various components. For example:
back to the list of tools Generate Dataset Dialog Box When you select the graphical design surface or a DataAdapter component, a Generate DataSet hyperlink appears at the bottom of the Property window. In the Generate Dataset dialog box, you can select one or more DataAdapter components on the design surface to query for schema information. The wizard then builds the XSD schema file and typed DataSet class for you. The wizard also gives you the option to add an instance of the DataSet class to the design surface as a component. For more information about the Generate Dataset dialog box, visit the following Microsoft Web site:
Generate Dataset Dialog Box
back to the list of tools
http://msdn2.microsoft.com/en-us/library/28xee971(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/28xee971(vs.71).aspx) DataAdapter Configuration Wizard With the DataAdapter Configuration Wizard, you can configure a DataAdapter that is added through Server Explorer, through the Data Form Wizard, or manually from the toolbox. This wizard includes the following options:
If you select optimistic concurrency, the original value of all fields is checked against the values in the database. If you want to use a TimeStamp or similar version number field to simplify the SQL statement and reduce the data payload, you must build the queries yourself in code or through the Query and View Designer. For more information about the Data Adapter Configuration Wizard, visit the following Microsoft Web site:
Data Adapter Configuration Wizard
back to the list of tools
http://msdn.microsoft.com/en-us/library/kb6bw5z5.aspx (http://msdn.microsoft.com/en-us/library/kb6bw5z5.aspx) Parameter Collection Editor You can use the Parameter Collection Editor to map command parameters to columns in the associated DataTable. You can also map the parameter to a particular row version. For example, when you update a column, the new value is obtained from the current version of the row. However, parameters in the WHERE clause that are used for concurrency checking obtain their value from the original version of the row. For more information about the Parameters Collection Editor, visit the following Microsoft Web site:
Parameters Collection Editor
back to the list of tools
http://msdn.microsoft.com/en-us/library/5xh44k5s.aspx (http://msdn.microsoft.com/en-us/library/5xh44k5s.aspx) Table Mapping and Column Mapping Editors With the DataAdapter, you can map table and field names so that the names that are used in a DataSet do not have to match those that are used in the database. You can use the Table Mapping and the Column Mapping Editors to map table and field names that are used in the database to different table and field names in a DataSet. For more information about the Table Mappings dialog box, visit the following Microsoft Web site:
Table Mappings Dialog Box
back to the list of tools
http://msdn.microsoft.com/en-us/library/hc615e85.aspx (http://msdn.microsoft.com/en-us/library/hc615e85.aspx) Data Link Properties Dialog Box When you select the ConnectString property in a Connection component, you can click Data Link Properties to connect to a new data source. If you are using a SqlConnection component, the data source must be a database in SQL Server 7.0 or later or you will receive an error. This is the same dialog box that is used to add a new connection to Server Explorer. back to the list of tools Typed DataSetOne of the end products of the Visual Database Tools is the strongly typed DataSet class. To generate the DataSet class, you can use one of the following methods:
Whenever you edit the schema file, the DataSet class file is automatically rewritten. If you want to customize the DataSet class, use one of the following methods:
Walkthroughs, Visual Studio .NET Help Topics, and Microsoft Knowledge Base ArticlesWalkthroughs provide mini-tutorials that walk you through typical application development scenarios. Microsoft Knowledge Base "How To" articles provide step-by-step instructions about how to do specific tasks.The Visual Studio .NET Help topics, walkthroughs, and Microsoft Knowledge Base articles in the sections to follow describe how to use Visual Database Tools and the typed DataSet. NOTE: The walkthroughs in the section to follow demonstrate how to use the Visual Database Tools to do a particular task; these walkthroughs are not a general tutorial about the tools. WalkthroughsIn Visual Studio .NET, click Index on the Help menu. In the Look For box, type Walkthroughs, data. The Index Results pane displays a list of data access walkthroughs.
Walkthrough: Creating a Master-Detail Windows Form http://msdn.microsoft.com/en-us/library/aa984462.aspx (http://msdn.microsoft.com/en-us/library/aa984462.aspx)
This walkthrough uses a DataAdapter component. The DataAdapter Configuration Wizard builds a typed DataSet. The walkthrough uses the XSD Editor to create a DataRelation and then binds controls through the Property window to the typed DataSet. Adding Tables and Columns to the Windows Forms
DataGrid Controlhttp://msdn.microsoft.com/en-us/library/aa984314.aspx (http://msdn.microsoft.com/en-us/library/aa984314.aspx)
This article demonstrates how to customize the appearance of a bound Windows
Form DataGrid control by adding DataGridTableStyle and DataGridColumnStyle objects through an editor that is opened from the Property
window. Visual Studio .NET Help Topics
What's New in Data http://msdn.microsoft.com/en-us/library/87sfaezs.aspx (http://msdn.microsoft.com/en-us/library/87sfaezs.aspx) Visual Database Tools http://msdn.microsoft.com/en-us/library/y5a4ezk9.aspx (http://msdn.microsoft.com/en-us/library/y5a4ezk9.aspx) Introduction to Server Explorer http://msdn.microsoft.com/en-us/library/t900cyed.aspx (http://msdn.microsoft.com/en-us/library/t900cyed.aspx) Databases in Server Explorer http://msdn.microsoft.com/en-us/library/byads6a9.aspx (http://msdn.microsoft.com/en-us/library/byads6a9.aspx) Creating Data Adapters Using Server Explorer http://msdn.microsoft.com/en-us/library/aa984315.aspx (http://msdn.microsoft.com/en-us/library/aa984315.aspx) Creating Data Adapters Using a Wizard http://msdn.microsoft.com/en-us/library/zc6tc8ew.aspx (http://msdn.microsoft.com/en-us/library/zc6tc8ew.aspx) Creating and Configuring Data Adapters Manually http://msdn.microsoft.com/en-us/library/z92w563z.aspx (http://msdn.microsoft.com/en-us/library/z92w563z.aspx) Creating New Typed Datasets with the XML Designer http://msdn.microsoft.com/en-us/library/1k3xyssf.aspx (http://msdn.microsoft.com/en-us/library/1k3xyssf.aspx) Microsoft Knowledge Base Articles315678
(http://support.microsoft.com/kb/315678/EN-US/
)
HOW TO: Create and Use a Typed DataSet by Using Visual Basic .NET
320714
(http://support.microsoft.com/kb/320714/EN-US/
)
HOW TO: Create and Use a Typed DataSet by Using Visual C# .NET
318039
(http://support.microsoft.com/kb/318039/EN-US/
)
HOW TO: Make a Typed DataSet Return a Default Value Instead of DBNull by Using Visual Basic .NET
318048
(http://support.microsoft.com/kb/318048/EN-US/
)
HOW TO: Make a Typed DataSet Return a Default Value Instead of DBNull by Using Visual C# .NET
TroubleshootingIf you experience problems or if you have questions, you can refer to the MSDN newsgroups where you can share your experiences with your peers. You can also use the Microsoft Knowledge Base where you can search for articles about specific issues.
MSDN Newsgroups The
third-party products that are discussed in this article are manufactured by
companies that are independent of Microsoft. Microsoft makes no warranty,
implied or otherwise, regarding the performance or reliability of these
products.http://msdn.microsoft.com/newsgroups/ (http://msdn.microsoft.com/newsgroups/) Searching the Knowledge Base http://support.microsoft.com/search/?adv=1 (http://support.microsoft.com/search/?adv=1) APPLIES TO
| Article Translations
|
Back to the top
