Getting Started with Oracle Berkeley DB 11gR2 and ADO.NET
Scope.NET Platforms 3.5 and higher running on Windows 32 and x64 bit platforms including Windows XP and Windows Server Vista Windows 7 Using Berkeley DB with ADO.NET and building applications using. NET languages such as C# and Visual Basic This tutorial and sample application uses C# Windows Mobile Platform and the Compact Framework is beyond the scope of this tutorial.
Building and Using ADO.NET Support with Oracle Berkeley DB Installation and Configuration ADO.NET Data Provider Documentation Optional Components Berkeley DB ADO.NET Application Introduction Project Reference Core Objects Used Classes Running BerkeleyDBwithADO
Installation and Configuration Required Software ADO.NET Package Includes Berkeley DB 11gR2 ( ) Visual Studio 2008 or 2010 Professional Download ADO.Net Package BDB SQL ADO.NET Package Expand and Build ADO.NET driver Expand dbsql-adodotnet zip or greater
Installation and Configuration Expand and Build ADO.NET driver Open SQLite.NET.2008 or SQLite.NET.2010 Select Load Project Normally on Security Warning Message see next slide Solution Configuration either DebugNativeOnly or ReleaseNativeOnly Solution Platform win32 (or x64) Win32 used here Build Project System.Data.SQLite.2008 Optionally build entire solution SQLITE.Interop.dll created either way Debug and run project named test All tests should run successfully after select run command
Building ADO.NET Support with Berkeley DB
Building ADO.NET Support with Oracle Berkeley DB Installation and Configuration ADO.NET Data Provider Documentation Optional Components Berkeley DB ADO Application Introduction Project Reference Core Objects Used Classes Running BerkeleyDBwithADO
Access Berkeley DB databases using the.NET Framework (Version 3.5) sork The build created required dll’s for ADO.NET System.Data.SQLite.dll is a custom data provider of System.Data.dll Contains overloaded classes Needed at design time and runtime Mixed assembly SQLite.Interop.dll Needed at runtime Copy to.exe directory. ADO.NET - Data Provider
ADO.NET - Documentation SQLite.NET Help File System.Data.SQLite Object Browser
Building ADO.NET Support with Berkeley DB ADO.NET Documentation to use
Optional Components are created if all requirements met and you build the Linq and/or SQLiteDesigner project files System.Data.SQLite.Linq.dll.Net Framework 3.5 SP1. SQLiteDesigner.dll SQLite.Designer requires Microsoft Visual Studio SDK. ADO.NET - Optional Components
Optionally can build the dbsql shell and Berkeley DB library for access outside of ADO.NET Open dbsql-adodotnet- 5.2.nn\build_windows\Berkeley_DB.sln Build solution file see Using the ADO.NET DriverUsing the ADO.NET Driver If plan to use more than dbsql, recommend downloading Berkeley DB Kit Berkeley DB Downloads Optional Components - dbsql
Building ADO.NET Support with Oracle Berkeley DB Installation and Configuration ADO.NET Data Provider Documentation Optional Components Berkeley DB ADO Application Introduction Project Reference Core Objects Used Classes Running BerkeleyDBwithADO
Application Introduction Visual Studio C# Windows Application Built using Visual Studio Professional 2008 Berkeley DB database using ADO.NET to perform CRUD operations Schema (subset of a real License Manager App) _idd * (text) user_id (text) app_package (text) Desc (text)
The License Application - Introduction Sample Data Row Downloaded fastvpn package _idd * “USER01~com.swcompany.fastvpn” User “USER01” app_package “com.swcompany.fastvpn” Desc (text) “ultra secure and fast vpn” Use Visual Studio to examine the application in more detail
Application Project Reference
Core Objects Used SQLiteConnection Establish Connection to Berkeley DB Database SQLiteDataAdapter Populates a DataSet and resolves updates with Berkeley DB Transmits changes made to the grid back to Berkley Db Dataset In-memory representation of data retrieved from Berkeley DB. DataSet consists of a collection of DataTable objects DataGridView Binds to Berkeley DB Data Source
ADO.NET Application – Class Files frmBerkeleyDB.cs Main Form Contains UI for Grid and CRUD operations Contains DataGridView Implements Save changes and Exit application Program.cs By Convention, the entry point for the BerkeleyDBwithADO application frmSignon.cs Simple signon form to identify use and assist in creating primary keys Needed when Synchronization is added
Running BerkeleyDBwithADO About to Insert a new package
Running BerkeleyDBwithADO Package inserted in Grid
Running BerkeleyDBwithADO File Save to Berkeley DB
Running BerkeleyDBwithADO Start Delete Operation highlight rows
Running BerkeleyDBwithADO Press Delete Key just before saving changes
Running BerkeleyDBwithADO Restart application to confirm changes
End of Tutorial