how to add mdf file to app_data folder in c#?

Posted by Prabu_Spark under ASP.NET on 1/21/2013 | Points: 10 | Views : 3745 | Status : [Member] | Replies : 1
Hi sir,
Tell me steps to add mdf file to app_data folder in c#. Kindly give me the solution for this problem.

[Hint: I am using the SqlServer 2005 as backend]

With regards,


Posted by: Ranjeet_8 on: 1/21/2013 [Member] [MVP] Gold | Points: 25

Try this

right-click the App_Data folder, point to "Add" and then click "New Item".
select "SQL Server Express DataBase"

<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

Please Mark As Answer if this helps you


Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response