473,385 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

asp.net app accessing my SQLSERVER DB using windows authentication

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
1 1215
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Peter Morris | last post by:
Hi, I'm having trouble connecting to SQLServer in my ASP program. here's the code <% dim objConnection, ObjRecorSet, strConnection, strOut, objCmd, objParameters Set objConnection =...
2
by: Jim Corey | last post by:
We're looking at logging on to SQLServer using Windows Authentication from an ASP app, and trying to figure out what will work. The following connection string works with Basic Authentication:...
36
by: Thomas | last post by:
after spending countless hours trying, i give up and hope to get some help in here. on server1 i got the web myweb.com with my test.asp. in the test.asp, i'm trying to read a file from an UNC...
3
by: Suhas Vengilat | last post by:
Hi, I am facing a problem accessing SQL Server using WindowsAuthentication. One Sharepoint application development team need a webpart to access one SQL Server Database using a service account...
2
by: news.microsoft.com | last post by:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. I guess I get this because, my pages are hosted on WinXP IIS and the sql server is on Win2k3. ...
0
by: Joergen Bech | last post by:
Fairly new to ASP.NET 1.1. Getting the error below when running application on a web server outside of my control, but only the first time I run it: 1. After a long period of inactivity (or...
3
by: Brad | last post by:
I'm setting up my new pc with all my VS.net projects and I'm missing something.....something I've done many times before without problem. I have several asp.net apps accessing secure .net web...
2
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
How to configure the IIS, ASPNET userID, Windows or SQL Authentiation, std or integrated security for SQLserver database? The VS.net 2002 web server and SQL Server client are at the same PC, ...
10
by: Anton | last post by:
Hi, when accessing a secured 3rd party webservice i'm getting a 401 HTTP Statuscode (unauthorized). When entering the url in a browser and entering the username and password manually, the wsdl is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.