I'm trying to connect to a SQL Server CE database in a C# web application (VB 2012) using this connection string:

using (SqlCeConnection conn = new SqlCeConnection(@"Data Source|DataDirectory|\MyData.sdf; Persist Security Info=False;"))


The problem is that I am getting an exception that the data source|datadirectory is not a supported keyword. I attempted to change this string to:

Data Source=MainDb.sdf;Persist Security Info=False;


But then I get an error that the Db cannot be found. The database is located in the App_Data folder. Any ideas?


Question: Hours for bacteria to form on raw steak
Answer: This steak should be discarded immediately,

See:  Why is it dangerous to eat meat which has been left out and then cooked?

While freezing will halt the growth, the pathogens have already had more than enough time to create poisons, some of which are not destroyed by freezing or cooking.

Also, it probably will now taste quite off, but that is not a safety issue.