Click here to Skip to main content
15,906,455 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900