Tutorials

 


VistaDB 3 box shot

  • Truly embedded ADO.NET 2 SQL database for Dot Net 2/3.x, Compact Framework and Mono
  • Less than 1 MB single assembly deployment
  • Cross-platform Windows, Linux and Mac OS X support through Mono
  • Easy migration from SQL Server TSQL data types and syntax
  • Royalty free distribution - Licensed per developer

Your first VistaDB application

This Getting Started shows how to quickly create a simple application that uses VistaDB. If you are new to VistaDB, please see Getting Started Overview in order to gain a broader understanding of how to convert existing databases to VistaDB. Developing database applications that use VistaDB is very similiar to using SQL Server. These instructions explain how to create a basic single form WinForms application that has a DataGridView component bound to an Employee table from a VistaDB Northwind.VDB3 database.

 

Camtasia Movie

You may also watch a screen presentation of the steps below being performed. Some users find this an easier way to get the basics of the system.

Watch first VistaDB application movie

The following steps are the ones taken in the movie. They are provided here in the same order presented in the video.

Part 1 - DataSet

  1. Run Visual Studio 2005
  2. From the Main Menu, select File -> New -> Project
  3. From the New Project form, select:
    Visual C# -> Windows -> Windows Application -> OK
  4. From the Main Menu, select Data -> Add New Data Source...
  5. From the Data Source Configuration Wizard -> Database-> Next
  6. Click "New Connection" button on the next form
  7. From the "Add Connection" form, click the "Change" button
  8. From the "Change Data Source" form, under Data Source, select "VistaDB Database File" and press OK
  9. Back on the "Add Connection" form, click the Browse button and select:
    "C:\Program Files\VistaDB 3.2\Data\Northwind.vdb3"
  10. Select Open Mode -> Nonexclusive Read Write
  11. Click "Test Connection" to make sure you can open the database and click OK
  12. Back on the "Data Source Configuration Wizard", you should see "VistaDB Database" for the connection. Click Next
  13. Rename the connection string "VistaDBConnectionString" and leave the "[x] Yes, save the connection" box checked. Click Next.
  14. In the Choose Your Database Objects page, click on the plus sign beside "+ Tables" to see the list of tables in Northwind.vdb3.
  15. Check "[x] Employees", leave the DataSet name "DataSet1" and click the Finish button

You just created a new DataSet called "DataSet1" and bound it to the "Employees" table. In Part 2, you will drop a grid on the form and connect it to DataSet1.

Part 2 - DataBinding

  1. From the Main Menu, select View -> Toolbox
  2. Click on All Windows Forms
  3. Drop the DataGridView component onto the form
  4. On the top right of the DataGridView component, click on the small arrow icon. This will display a fly-out drop down toolbar.
  5. Under "Choose Data Source", select EmployeesBindingSource
  6. From this same fly-out toolbar, click on Preview Data at the bottom
  7. From the Preview Data form, click on Preview. This will display the data. Click Close when done.
  8. Save and run.

This part builds the forms and binds it to the DataSet you built in Part 1. All of these steps are identical to how you would perform databinding in SQL Server.