How to access Database which was in APP_DATA
I developed a sample for membership and roles using the tutorial available. Now what i need is if i run my example in the other machine i would like to login and access the pages with the user name and开发者_StackOverflow社区 password that were created using Asp.Net Configuration in my machine can any one give me an idea to achieve this
This may help you
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=.\SQLExpress;Integrated Security=SSPI;AttachDBFilename=c:\inetpub\wwwroot\appname\App_Data\ASPNETDB.mdf;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
As per your need try this it will works
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Data Source=.\SQLEXPRESS;AttachDbFileName=|DataDirectory|Login.mdf;Integrated Security=True;User Instance=True " providerName="System.Data.SqlClient"/>
</connectionStrings>
精彩评论