Your first VistaDB 3 application using Visual Studio
2005
|
-
Truly embedded ADO.NET 2 SQL database for .NET 2+, CF 2 and Mono
-
Less than 1 MB single assembly deployment
-
Cross-platform Windows, Linux and Mac OS X support using the Mono Project
-
Easy migration from SQL Server TSQL
Royalty-free distribution
|
 |
 |
This Getting Started shows how to quickly create a simple
application that uses VistaDB. If you are new to VistaDB, please see
Quick Overview in order to gain a broader
understanding of what VistaDB can do for you. 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 capture of the steps below being performed.
The following steps are the ones taken in the movie. They are provided here in the same order presented in the video.
Part 1
- Run Visual Studio 2005
- From the Main Menu, select File -> New -> Project
- From the New Project form, select:
Visual C# ->
Windows -> Windows Application -> OK
- From the Main Menu, select Data -> Add New Data Source...
- From the Data Source Configuration Wizard -> Database
-> Next
- Click "New Connection" button on the next form
- From the "Add Connection" form, click the "Change" button
- From the "Change Data Source" form, under Data Source,
select "VistaDB Database File" and press OK
- Back on the "Add Connection" form, click the Browse button
and select:
"C:\Program Files\VistaDB 3.2\Data\Northwind.vdb3"
- Select Open Mode -> Nonexclusive Read Write
- Click "Test Connection" to make sure you can open the
database and click OK
- Back on the "Data Source Configuration Wizard", you should
see "VistaDB Database" for the connection. Click Next
- Rename the connection string "VistaDBConnectionString" and
leave the "[x] Yes, save the connection" box checked. Click Next.
- In the Choose Your Database Objects page, click on the plus
sign beside "+ Tables" to see the list of tables in Northwind.vdb3.
- 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
- From the Main Menu, select View -> Toolbox
- Click on All Windows Forms
- Drop the DataGridView component onto the form
- On the top right of the DataGridView component, click on the
small arrow icon. This will display a fly-out drop down toolbar.
- Under "Choose Data Source", select EmployeesBindingSource
- From this same fly-out toolbar, click on Preview Data at the
bottom
- From the Preview Data form, click on Preview. This will
display the data. Click Close when done.
- Save and run.
|