views:

31

answers:

1

I am using Sync Framework in SL App to sync Sql Server and local SqlCe DB.

Having problem in connecting to Sqlce. Getting an Exception here

new SqlCeConnection("http://localhost/Sample.sdf");

Error:
ArgumentException was unhandled by user code. The connection object is not valid. Cannot create a new instance of the connection object."

Thanks

A: 

You must use a local file path, not an http path for the data source

ErikEJ
Thanks Erik, You are right. The Main problem for Error is SQL Server Compact is not intended for ASP.NET development. Used a turn Around by using following code AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true); .
raghavendra