开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜