Aug 08, 2007 03:18 AM|johram|LINK
SQL server allows two types of authentication: windows and SQL. By default, when you create a connection to an SQL server, it will pick windows authentication for you. So when you run the web on your local machine, it will run in the context of your user.
And the connection to SQL will also be done in the context of your user. Now, when you browse the web from a server running IIS, it will run with a local machine account. This account cannot access the SQL server over the network.
So basically, you have two options here. If you're on a local network and your users are well-known then it might be appropriate to let SQL use windows authentication, and you also make sure your web uses (integrated) windows authentication.
The other option is to switch to SQL authentication, which means that your web will connect to the SQL server with the same user every time. And this user is local to the SQL server only, no need for an AD account. A problem with this solution is that you
need to store the username and password somewhere in your web.config. But there are ways to encrypt the connection string info with help of aspnet_regiis.exe command line tool. See this article for more info on this: http://aspnet.4guysfromrolla.com/articles/021506-1.aspx
If this post was useful to you, please mark it as answer. Thank you!