%META:TOPICPARENT{name="VirtODBCEntityFrameworkUsage"}% ===Visual Studio Windows DataGrid 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% 2. Create a Web Application project by going to the File menu in Visual Studio and choosing New Project. %BR%%BR% 3. When the New Project window appears, choose either Visual Basic or Visual C# as your programming language.%BR%%BR% 4. Within the language category, click on Windows and select Windows Form Application from the right-hand panel. %BR%%BR% 5. Choose a name for the project, for example VirtWindowsFormApplication, and click OK. %BR%%BR%%BR%%BR% 6. In the Toolbox, expand Data Controls and drag the DataGridView control onto the form. %BR%%BR%%BR%%BR% 7. Click on the little arrow in the top right of the DataGridView control to load the DataGridView Task menu. %BR%%BR%%BR%%BR% 8. Click on the Choose Data Source list box. %BR%%BR%%BR%%BR% 9. Click on the Add Project Data Source link to connect to a data source. %BR%%BR%%BR%%BR% 10. 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% 12. In the Data Source Configuration Wizard dialog Choose your Data Connection page, select the New Connection button. %BR%%BR%%BR%%BR% 13. In the Choose Data Source dialog, select the OpenLink Virtuoso Data Source from the list and click Continue. %BR%%BR%%BR%%BR% 14. In the Connection Properties dialog, specify the hostname, portno, username and password for the target Virtuoso Server and click the Advanced button. %BR%%BR%%BR%%BR% 15. In the Advanced Properties dialog, set the Database parameter to NWIND and click **OK**. %BR%%BR%%BR%%BR% 16. Press the Test Connection dialog to verify that the database is accessible. %BR%%BR%%BR%%BR% 17. Leave the default connect string name--NWINDConnectionString--and click Next. %BR%%BR%%BR%%BR% 18. From the list of available tables returned for the NWIND database, select the Products table to be associated with the DataGridView control. %BR%%BR%%BR%%BR% 19. The column names of the selected table will be displayed in the the DataGridView. %BR%%BR%%BR%%BR% 20. Resize the form and DataGridView to allow all columns to be visible, if possible. %BR%%BR%%BR%%BR% 21. To test the application, simply hit Ctrl+F5 within Visual Studio or select Start Debugging from the Debug menu. %BR%%BR%%BR%%BR% 22. The data from the Products table will be displayed in the DataGrid. %BR%%BR%%BR%%BR% The task is now complete.