Click here to Skip to main content
15,890,897 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i am using asp.net (visual studio 2010), sql server 2008, & iis 5.1;


and i done all the task like create virtual directory etc.

whenever i am running connectivity code. then it give the error


"Cannot open database "my" requested by the login. The login failed.
Login failed for user 'G\ASPNET'."


my connection string is =>

connection String ="Data Source=g\sqlexpress;Initial Catalog=my;Integrated Security=True "

plese help me.

thanks in advance
Posted
Updated 23-Sep-10 6:20am
v2

1 solution

"please give me the solution quickly." This is very rude. This is a volunteer site and people will answer, or not, on their own time, not yours. If you want a quick answer, then pay for support.

The error message is quite self-explanatory. The current user does not have access to the database. You are must likely using the aspnet user if not using Windows authentication
 
Share this answer
 
Comments
[no name] 23-Sep-10 12:19pm    
Original comment from OP: i ma just doing a request. if u not like it. so not give me the ans , thats it.

You have been given an answer and guideance as to proper behavior for this community. If you can't follow these rules, then don't use this site.
dilip.aim11 23-Sep-10 12:21pm    
thnkssssssssss
dilip.aim11 23-Sep-10 12:22pm    
sory.

but i not understand
"You are must likely using the aspnet user if not using Windows
authentication"
plese explain me
[no name] 23-Sep-10 12:32pm    
If you are using Windows authentication ASP.NET will authenticate the user accessing the site and use those credentials when making any requests. If not using Windows authentication ASP.NET will execute under the aspnet user that was created when you installed and configured it.
dilip.aim11 23-Sep-10 12:42pm    
i am using the window authentication. same code is run sucessfully when i run that code from direct asp.net.
but using iis it will create a problem.

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