Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database connection classes for a C# pocket PC application

Status
Not open for further replies.

polocar

Programmer
Sep 20, 2004
89
IT
Hi all,
I'm writing in Visual C# (of Visual Studio .NET 2003 Professional Edition package) a program that must run in a pocket PC (with Pocket PC 2002 installed), so when I created the project I selected "Visual C#" as "Project Type" and "Smart Device Application" as "Model".

This program must connect to an Access database (stored in the Pocket PC too) and read, edit and update its tables' values.

To my unspeakable horror, I noticed that the ADO.NET namespace System.Data.OleDb and its classes (as OleDbConnection) aren't supported in .NET Compact Framework and Windows CE!!!

I also noticed that the other ADO.NET namespace (System.Data.SqlClient) and its classes (as SqlConnection) are obviously supported, but I have read in MSDN library that they can connect only to SQL Server databases (not Access databases).

Can you tell me what kind of namespaces and classes I must use to interface to an Access database in a .NET C# Pocket PC application?

Thank you very much
 
I didn't try but using OdbcConnect, OdbcCommand classes should work and a DSN to that database is enough.
obislavu
 
I tried to use ODBC classes as your suggestion, but they are not included in the .NET Compact Framework (I controlled OdbcConnection class in the MSDN library, and I found that it is supported only by PC platforms: Windows 98, 2000, XP or 2003 Server).
What can I do? Is it possible that there isn't an ADO.NET class that lets you interface to an Access database in .NET Compact Framework???!!!
Thanks
 
Yes, reading MSDN seems to be available only SQL Server CE.NET:
"The .NET Compact Framework provides a subset implementation of ADO.NET and includes the SQL Server CE .NET data provider.
The System.Data.OleDb namespace is not supported.".
The System.Data.SqlServerCe namespace exposes SQL Server CE in the .NET Compact Framework. In addition, the .NET Compact Framework also includes the System.Data.SqlClient namespace for developing Windows CE-based applications that directly access databases in SQL Server 7.0 or later.
obislavu



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top