Not access to db of membership and roles (ASPNETDB.MDF), when web site run in publish mode (from iis not from VS2010)
Hi
After I writes necessary instructions for membership and role in web.config, a db by name "aspnetdb" will be produced in folder "App_Data". When web site will be compiled in VS2010 , the new role and user will be created and added to db . ConnectionString is :
<add name="ApplicationServices" connectionstring="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true" providername="System.Data.SqlClient">
I want to set up web site on a server of local network of our office ( on intranet network no on internet).
for accessing of other client to the web site in network, I Published site and run it by IE. But could not access to db.
then I remove aspnetdb from "App_Data" and attach it in SQL SERVER. ConnectionString also is :
<add name="base_ConnectionString" connectionstring="Data Source=192.168.90.2\jack2008;Initial Catalog=aspnetdb;Integrated Security=SSPI;User ID=us1;Password=abcdef45" providername="System.Data.SqlClient">
THE EROR IS :
Cannot open database "aspnetdb" requested by the login. The login failed.
Login failed for user 'myuser1'.
In the first , for run web site by ather clients, is it necessary to change db connection type from “file” to “attach”?
Then , When web site will be compiled in VS2010 , the new role and user will be created and added to db. But when it be published and run by IIS , it cant access to db. By the way web site uses some other db which work properly in network.
But cant access to "aspnetdb" in iis .
Also , I define instructions of membership and role in machin.config like in web.config .
Why it cant access to db when web site run by browser?(in vs2010 it work properly)
Thanks very much