Skip to main content

Articles

Featured Products

Windows Mobile Developer Controls
Windows Mobile Developer Controls
Stay in touch using the DEVBUSS RSS feeds.
 

News

Windows Mobile Developer Controls
Sapphire Soltuions

Pocket Access Data provider for the .NET Compact Framework

Written by Peter Foot  [author's bio]  [read 104075 times]
Edited by Derek

Download the code

Page 1  Page 2  Page 3 

Data Binding

While the new language features in .NET give you more choice about how you iterate through items, you dont have to do this when using Data Binding. The Recordset object exposes the required interfaces so that you can assign it directly to the DataSource property of a DataGrid and display the Recordset in tabular form, and you can do it with a single line of code!

grdTreeGrid.DataSource = rsTallTrees

The grid control will redraw putting in the contents of the table data. It will also use the field names as column headers.

Recordset displayed in a DataGrid control

While the Compact Framework Grid does not allow point and click editing of cells, you can do it programmatically. The sort order and fields displayed depend solely on your SQL query used to open the Recordset. So you have complete freedom here from either displaying a table straight from the database or restricting, reordering columns, applying sort orders or joining tables.

Synchronisation

One of the benefits of using a Pocket Access solution is that you can use the provider built into ActiveSync to keep your database synchronised between your desktop PC and Pocket PC database. You can even set up synchronisation programmatically from the full desktop .NET Framework. The code for this is available in the forums.

Deployment

The code required for the ADOCE .NET Wrapper can be packaged up into a single CAB file (per processor type) along with your application files. This means you can either distribute the CAB file direct to a device to be installed with a tap, or you can use a desktop installer to install the package through ActiveSync. The full version of ADOCE .NET Wrapper includes all the files you need and a skeleton INF file and instructions to build your customised CAB files.

Source Code

Sample Pocket Access Viewer application

The source code project available with this article displays a very simple Pocket Access Viewer application, it uses a few different techniques to display the data. To run the sample application you will need the ADOCE .NET Wrapper installed on your development machine. A Demo package including full functionality Runtime files for the emulator is available from the InTheHand.com website along with full documentation of the library.

Previous Page