SQL CE with ASP .NET Application

Use the below code snippet to make SQL CE it work with ASP .NET application
[C#]
protected void Page_Load(object sender, EventArgs e)
{
AppDomain.CurrentDomain.SetData(“SQLServerCompactEditionUnderWebHosting”, true);
string connectionString = @”Data Source=|DataDirectory|\Northwind.sdf”;
Northwind nw = new Northwind(connectionString);
var DataSource = nw.Orders.Skip(0).Take(100).Select(o => o);
}
[WebConfig]
<assemblies&gt
<add assembly=”System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91″&gt
</assemblies &gt

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Powered by WordPress.com.

Up ↑

%d bloggers like this: