asp.net app accessing my SQLSERVER DB using windows authentication

P

Paul

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
 
S

S. Justin Gengo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top