www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

Installation Guide

Virtuoso for Windows
Virtuoso for Linux (Enterprise Edition)
Virtuoso for Unix (Enterprise Edition)
Virtuoso for Unix (Personal Edition)
Virtuoso for Mac OS X
Virtuoso ADO.Net Data Grid Form Application
Using Visual Studio 2008 to Build an Entity Frameworks based Windows Form Application
Using Visual Studio 2008 to Build an ADO.NET Data Services based Application
Windows Form Application for accessing Virtuoso RDF data via SPASQL using the Virtuoso ADO.Net Provider
Creating a Web Browser Application to Access RDF Data Using The Virtuoso ADO.Net Provider
Creating a Silverlight Application to consume the service
Creating A Simple .NET RIA Services Application To Display Data From Virtuoso
Creating a .Net RIA Services Application That Will Update Virtuoso Data
Cluster Installation and Config

2.6. Virtuoso ADO.Net Data Grid Form Application

This section 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 a Virtuoso database.

  1. Launch the Visual Studio 2008 SP1 IDE.
    Visual Studio
    Figure: 2.6.1. Visual Studio
  2. Create a Web Application project by going to the File menu in Visual Studio and choosing New Project.
  3. When the New Project window appears, choose either Visual Basic or Visual C# as the programming language.
  4. Within the language category, click on Windows and select Windows Form Application from the right-hand panel.
  5. Choose a name for the project, for example VirtuosoDataGridApp, and click OK.
    name for the project
    Figure: 2.6.1. name for the project
  6. From the Data, menu select the Show Data Sources menu item to display a list of available Data sources.
    Show Data Sources
    Figure: 2.6.1. Show Data Sources
  7. Click on the Add New Data Source link to add a new data source.
    Add New Data Source
    Figure: 2.6.1. Add New Data Source
  8. In the Data Source Configuration Wizard dialog Choose Data Source Type page, select the Database data source type and click Next.
    Data Source Configuration Wizard
    Figure: 2.6.1. Data Source Configuration Wizard
  9. In the Data Source Configuration Wizard dialog Choose your Data Connection page, select the New Connection button.
    Data Connection page
    Figure: 2.6.1. Data Connection page
  10. In the Choose Data Source dialog, select OpenLink Virtuoso Data Source from the list and click Continue.
    OpenLink Virtuoso Data Source
    Figure: 2.6.1. OpenLink Virtuoso Data Source
  11. In the Add Connection dialog, specify the hostname, portno, username, and password for the target Virtuoso Server and check the Save Password check box.
    Add Connection dialog
    Figure: 2.6.1. Add Connection dialog
  12. Select the Select Database From List radio button and choose School from the drop down list of available databases.
    Select Database From List
    Figure: 2.6.1. Select Database From List
  13. Click the Test Connection button to verify the connection is successful and then click OK to add the connection.
    Test Connection
    Figure: 2.6.1. Test Connection
  14. Select the Yes, include sensitive data in the connect string radio button and click Next to continue.
    connect string
    Figure: 2.6.1. connect string
  15. In the Choose your Database Objects dialog select the table and columns to be queried, the shippers table is used in this example.
    Choose your Database Objects
    Figure: 2.6.1. Choose your Database Objects
  16. A DataSet for the shippers database object is created
    shippers database
    Figure: 2.6.1. shippers database
  17. From the drop down list box next to the Shippers table ensure the DataGridView item is selected
    DataGridView
    Figure: 2.6.1. DataGridView
  18. Drag the Shippers DataSet item onto the Form to create a scrollable and editable association of the Shippers table object with the Data Grid View automatically.
    Drag
    Figure: 2.6.1. Drag
  19. From the Debug Menu select the Start Debugging menu item to run the application.
    Debug
    Figure: 2.6.1. Debug
  20. The data in the Shippers table will be displayed in the DataGrid application created.
    DataGrid
    Figure: 2.6.1. DataGrid
  21. A new row can be inserted (updated or deleted) as indicated for the new DHL record inserted below and the save button clicked to save the change to the database.
    new row
    Figure: 2.6.1. new row
  22. The Virtuoso Interactive SQL tab of the Conductor can be used to run the query select * from Demo..Shippers.
    Interactive SQL tab
    Figure: 2.6.1. Interactive SQL tab
  23. To verify the change has been successfully made in the database.
    verify
    Figure: 2.6.1. verify

The task is now complete.