How to configure your web application when you want to use SQLServerCE database?

Posted by Tripati_tutu under ASP.NET category on | Points: 40 | Views : 3819
To use SQLServerCE(compact edition) database in your application, you have to configure Web.config file and Global.asax file in your application as mentioned below.

Mention below connection string in Web.config file:
<add name="SqlConn" connectionString="DataSource=~\Bin\DataBaseName.sdf;password=abc;Persist Security Info=False" providerName="System.Data.SqlClient"/>

Mention below string in script tag of Global.asax:
<script runat="server">
void Application_Start(object sender, EventArgs e)
//Code that runs on application startup
AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);

Comments or Responses

Login to post response