RAD Studio for Microsoft .NET |  |

Creating Database Projects from the Data Explorer
See Also
Collapse All

You can drag and drop data from the Data Explorer to any forms such as Windows Forms or Web Forms, and Global.asax files. to populate datasets and quickly build a database project. This allows you to automatically hook up database components to your project and eliminates the need to provide a connection string, which can be prone to errors if entered manually.

To create a database project from the Data Explorer

1. Make sure you have a live connection to a database.
2. From the View menu, select Data Explorer.
3. Choose FileNewOther and select a Delphi for .NET project. Typically, this will be either a Windows Form, a VCL Form, or an ASP.NET application.
4. Expand the Data Explorer Tree by drilling down to the Table or View level. If the connection to your database is live, the small red x will disappear when you expand the connection node for the database. If it's not live, you may need to modify the connection string.
5. Using the cursor, grab one of the tables named in the list.
6. Drag and drop the table object onto your form. An AdoDbxConnection and an AdoDbxDataAdapter appear in the component tray.
7. Specify the appropriate database properties for each database component. For instance, set the Active property to True if you want to be able to view data in your component at design time.

Note: A DataGrid will not appear automatically so make sure you drop a DataGrid component onto your form to appropriately display data, when necessary.
See Also

ADO.NET Component Designers

Browsing a Database

Executing SQL in the Data Explorer

Modifying Connections

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!