0

I am writing an application to run on a windows embedded ce 6.0. the application needs to have access to a sql database and insert records into it. My boss said i have to use Odbc commands, but so far i haven't seen proof that windows embedded ce 6.0 supports Odbc at all. Can someone confirm that for me please before I go to my boss and humiliate myself in case I am wrong :p? and In case i cannot use Odbc: is there any alternative?

Thank you for your help.

Chucri
  • 17
  • 3
  • 12

2 Answers2

0

Windows CE 6.0 does not support ODBC:

http://social.msdn.microsoft.com/Forums/en/sqlce/thread/ed42734d-1594-4fe0-90ca-9e55771421af

No, there’s no such API. ODBC is not supported on CE and OLEDB driver is not available.

... or ...

http://docs.oracle.com/html/B10100_01/wnovw.htm

Windows CE does not support the ODBC driver manager.

However, one good alternative is the CE variant of standard (VB6 era) ADO, ADOCE:

http://msdn.microsoft.com/en-us/library/ms834317.aspx

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • Thank you, so another question is when I Type the line using System.Data.Odbc; visual studio 2008 is not recognizing Odbc, why is that? – Chucri Jan 18 '12 at 19:25
  • 1
    Note the C# tag in the question – ctacke Jan 18 '12 at 19:26
  • ADOCE support was dropped long ago, along with the entire set of eVB runtimes. You cannot use ADOCE from managed code at all. – ctacke Jan 18 '12 at 19:34
  • Okay! thank you, I'll check with my boss and ask him why he was choosing Odbc – Chucri Jan 18 '12 at 19:40
0

The Compact Framework has no support for ODBC. What type of database do you need to connect with? Many (SQL Server, Oracle, MySQL, SQLite, etc) have ADO.NET Providers

Here's an example for using the SQL Server provider.

ctacke
  • 66,480
  • 18
  • 94
  • 155
  • I need to connect to sql server database (remotely) – Chucri Jan 18 '12 at 19:29
  • The System.Data.SqlClient (see the link in the answer) is the way to go. – ctacke Jan 18 '12 at 19:34
  • Okay! thank you, I'll check with my boss and ask him why he was choosing Odbc. – Chucri Jan 18 '12 at 19:39
  • The example you gave is for windows mobile 6.0 which is different from windows embedded ce 6.0 – Chucri Jan 18 '12 at 20:50
  • For what you're doing, no it's not. The process for connecting to a SQL Server from the Compact Framework is the same for all versions of Windows CE (well, except Windows Phone). – ctacke Jan 18 '12 at 22:20
  • Ok! So I am using SqlClent now but I am getting an error message every time I attempt to open The SqlConnection: can't find pinvoke dll 'dbnetlib.dll' Any ideas on how to fix that! – Chucri Jan 26 '12 at 20:57