Connect to SQL Server Mobile Edition via VS2005 (Data Provider)

  • Thread starter Thread starter Martin Priebe
  • Start date Start date
M

Martin Priebe

Hi,


I try to connect my application via Data Provider to my SQL Mobile DB.

With the ServerExplorer all works fine.
new Connection - via ActiveSync - Data Provider for SQL Server Mobile
Edition
.... fine !

But now i want to use this in my code.
I have the ConnectionString .. "Data Source = Mobile Device \ .... .sdf"
but how can i change my Data Provider? ('for SQL Server' to 'for for SQL
Server Mobile Edition')

When i use the namespace System.Data.SqlClient the SqlConnection class try
to connect with a "normal" Sql Server 2005 database.


Is there a possibility to fix that problem ?

I only want to use a SqlConnection in my code to connect my application with
the database on my device. (via ActiveSync)


thx a lot
Martin
 
Try using the System.Data.SqlCeClient namespace instead of
System.Data.SqlClient.

Regards,
Rick D.
 
Back
Top