Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to SQL CE db using SQLConnection

Pretty straightforward question. I'm building an app which reads data from a SQL Server 2005 instance. I wanted to run some tests on my laptop (which does not have SQL 2005) so I was looking at swapping in a local database for the purpose of the tests.

I'm using VS2008 so the Compact Edition DB seemed a natural choice. I had hoped to just swap out my connection string, but it seems It will only let me connect to the CE database using the SqlCeConnection and not SqlConnection. Any way around this, modifiers I can use in the connection string perhaps?

like image 444
TygerKrash Avatar asked Apr 27 '09 11:04

TygerKrash


1 Answers

It's actually very possible to user SQL CE instead of full-blown SQL Server by only modifying configuration parameters: change connection string and use IDbXXX family interfaces wherever possible instead of platform-specific SqlXXX and SqlCeXXX ones. See DbProviderFactories.

Be advised, however, of differences in SQL dialects of these two platforms.

like image 55
Anton Gogolev Avatar answered Sep 20 '22 22:09

Anton Gogolev