By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,827 Members | 2,177 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,827 IT Pros & Developers. It's quick & easy.

asp.net app accessing my SQLSERVER DB using windows authentication

P: n/a
Hi

My web page is accessing a SQL DB to display some data. It works fine using
login/password security on the sql server database, but I'm trying to use
WIndows authenication and I get the message
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
My Connectionstring
connectionstring = "packet size=4096;integrated security=SSPI" _

& ";data source=" & theserver.Text & ";persist security info=false;initial
catalog=msdb"

My IIS server project has anonymous login and integrated windows
authenication checked.

Thanks

Paul


Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Paul,

You need to do two things:

In your web.config file insert the tag:

<identity impersonate="true" />

(place it just under the tag:
<authentication mode="Windows" />

This will cause the web app to run as the anonymous web account:
iusr_[MachineName].

If you want (and it's recommended) you can create a new user account just
for your app and then set the web site's anonymous account in IIS to run
under that user account.

Whether you create an account or stick with the iusr account you then need
to add that account the the sql server users and give it permissions to your
stored procedures (or any other access it needs) in the database.

I hope this helps,
--
S. Justin Gengo, MCP
Web Developer
Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"Paul" <pe@nospam.com> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
Hi

My web page is accessing a SQL DB to display some data. It works fine using login/password security on the sql server database, but I'm trying to use
WIndows authenication and I get the message
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
My Connectionstring
connectionstring = "packet size=4096;integrated security=SSPI" _

& ";data source=" & theserver.Text & ";persist security info=false;initial
catalog=msdb"

My IIS server project has anonymous login and integrated windows
authenication checked.

Thanks

Paul

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.