Click here to Skip to main content
15,886,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello!
I am hosting a website using win xp and IIS5, and SqlServer2008 server.
I Configured my database as i was supposed to. When I try to access some data from database I get an error:
"Cannot open database "PlanetWrox" requested by the login. The login failed.
Login failed for user 'DRA-D50A56C2451\ASPNET'."
The same error is both in sql and windows authentication.
This is my connection string in web.config:

</connectionStrings>
    <clear />
    <add name="PlanetWroxConnectionString1" connectionString="Data Source=DRA-D50A56C2451; Initial Catalog=PlanetWrox;Trusted_Connection=True" providerName="System.Data.SqlClient" />
    <add name="PlanetWroxEntities" connectionString="metadata=res://*/App_Code.PlanetWrox.csdl|res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=DRA-D50A56C2451;Initial Catalog=PlanetWrox;Trusted_Connection=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
    <add name="LocalSqlServer" connectionString="Data Source=DRA-D50A56C2451;Initial Catalog=aspnetdb;Trusted_Connection=True" providerName="System.Data.SqlClient" />
  </connectionStrings>


I also enabeled tcp/ip and namepipes in sql config manager...

Is there any compatibiliy issue with IIS5 and Sql2008?
I tried all kinds of solutions... Please help!!
Posted
Updated 10-Dec-10 18:22pm
v2
Comments
AspDotNetDev 10-Dec-10 19:36pm    
You need to fix your PRE blocks.
Abdul Quader Mamun 11-Dec-10 1:45am    
Is this windows authentication?
draxaman 11-Dec-10 2:55am    
I am having trouble both in windows and sql authentication...

Thank you for your question. You can try like bellow.

web.config
XML
...
 <system.web>
  ...
  <authentication mode="Windows"/>
    <identity impersonate="true" userName="<domain>\<UserName>" password="<password>"/>
    ...
 </system.web>
 ...



Thanks,
Mamun
 
Share this answer
 
Comments
Sandeep Mewara 11-Dec-10 3:13am    
Comment from OP:
Mamaun: thank you, but it still nothing... Is there some permission issue, because i can connect to sql management studio with both kinds of authentications, but website isn't allowed, i know that connections are ok, because if i specify them different i get an error that server could not be found...
(tried giving the user 'owner' role in sql server authentication over the database)... :(
Abdul Quader Mamun 11-Dec-10 3:21am    
In SQL Server 2005 Surface Area Configuration select remote connection then choose Local and remote connection. and OK.

Thanks
Please use userid and password in your connection string.In IIS if we don't provide userid and Password we get this kind of error.
 
Share this answer
 
Please, go to the following link to resolve the issue

http://msdn.microsoft.com/en-us/library/bsz5788z.aspx[^]
 
Share this answer
 

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