%META:TOPICPARENT{name="VirtFirebirdEntityFrameworkUsage"}%
---++ Virtuoso ADO.Net Data Grid Form Application
This article details the steps required to create a simple Visual Studio 2008 Windows Form application with associated DataGridView control for displaying data in selected tables from the target database.
1 Launch the Visual Studio 2008 SP1 IDE.
%BR%%BR%
%BR%%BR%
1 Create a Web Application project by going to the File menu in Visual Studio and choosing New Project.
1 When the New Project window appears, choose either Visual Basic or Visual C# as the programming language.
1 Within the language category, click on Windows and select Windows Form Application from the right-hand panel.
1 Choose a name for the project, for example VirtuosoDataGridApp, and click OK.
%BR%%BR%
%BR%%BR%
1 From the Data, menu select the Show Data Sources menu item to display a list of available Data sources.
%BR%%BR%
%BR%%BR%
1 Click on the Add New Data Source link to add a new data source.
%BR%%BR%
%BR%%BR%
1 In the Data Source Configuration Wizard dialog Choose Data Source Type page, select the Database data source type and click Next.
%BR%%BR%
%BR%%BR%
1 In the Data Source Configuration Wizard dialog Choose your Data Connection page, select the New Connection button.
%BR%%BR%
%BR%%BR%
1 In the Choose Data Source dialog, select OpenLink Virtuoso Data Source from the list and click Continue.
%BR%%BR%
%BR%%BR%
1 In the Add Connection dialog, specify the hostname, portno, username, and password for the target Virtuoso Server and and check the Save Password check box.
%BR%%BR%
%BR%%BR%
1 Select the Select Database From List radio button and choose employee from the drop down list, assuming the Virtuoso Demo Database is installed.
%BR%%BR%
%BR%%BR%
1 Click the Test Connection button to verify the connection is successful and then click OK to add the connection.
%BR%%BR%
%BR%%BR%
1 Select the Yes, include sensitive data in the connect string radio button and click Next to continue.
%BR%%BR%
%BR%%BR%
1 In the Choose your Database Objects dialog select the table and columns to be queried, the COUNTRY table is used in this example.
%BR%%BR%
%BR%%BR%
1 A DataSet for the employee database object is created
%BR%%BR%
%BR%%BR%
1 From the drop down list box next to the COUNTRY table ensure the DataGridView item is selected
%BR%%BR%
%BR%%BR%
1 Drag the COUNTRY DataSet item onto the Form to create a scrollable and editable association of the COUNTRY table object with the Data Grid View automatically.
%BR%%BR%
%BR%%BR%
1 From the Debug Menu select the Start Debugging menu item to run the application.
%BR%%BR%
%BR%%BR%
1 The data in the COUNTRY table will be displayed in the DataGrid application created.
%BR%%BR%
%BR%%BR%
1 A new row can be inserted (updated or deleted) as indicated for the new "1111" record inserted below and the Save button clicked to save the change to the database.
%BR%%BR%
%BR%%BR%
1 The Virtuoso Interactive SQL tab of the Conductor can be used to run the query select * from "employee"."fire"."COUNTRY"
%BR%%BR%
%BR%%BR%
1 To verify the change has been successfully made in the database.
%BR%%BR%
%BR%%BR%
The task is now complete.