Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SQL server with ASP.NET app. anonymous user

Status
Not open for further replies.

dokken

Programmer
Mar 7, 2001
61
US
I am trying to write an ASP.NET application. I want to access a SQL server database. The way I did this in the old asp was to change the anonymous user account from iusr_machine to a domain userid/service account. I then give this account access to the sql server database. How can I tell my ASP.NET app to use the anonymous user id set up in IIS? It keeps wanting to use ASPNET.
 
Is there some reason you can't use a DSN or even a Connection String?

-pete
 
I do use a connection string and I use integrated security so I don't have to have the password hardcoded.
 
User in ASP.NET pages is always a ASPNET and you can't change it. If your database is on the same machine like IIS than in sql server allow access to ASPNET user for your database. If your sql server is on another machine you must use windows and sql authentication, so than you use connection string like:
"server=myserver;UID=sa;pwd=mypassword;database=mydatabase"
 
You really don't want to allow anonymous users access to your database. It would make your site easy to hack. What you can do so that you don't have to hardcode your password is to store the connection string in your web.config file.

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top