473,671 Members | 2,367 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 Connectionstrin g
connectionstrin g = "packet size=4096;integ rated security=SSPI" _

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

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

Thanks

Paul


Nov 17 '05 #1
1 1228
Paul,

You need to do two things:

In your web.config file insert the tag:

<identity impersonate="tr ue" />

(place it just under the tag:
<authenticati on 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.co m> wrote in message
news:u9******** ******@TK2MSFTN GP12.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 Connectionstrin g
connectionstrin g = "packet size=4096;integ rated security=SSPI" _

& ";data source=" & theserver.Text & ";persist security info=false;init ial
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
3623
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 = Server.CreateObject ("ADODB.Connection") strConnection = "DSN=SQL_Tracker;Database=Tracker;UID=sa;PWD=;" objConnection.Open strConnection ....
2
1435
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: driver={SQL Server};SERVER=MyServer;Database=MyDB;Trusted_Connection=yes; Is there a way to do this with IIS security set to Integrated Windows Authentication?
36
16369
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 path with a FSO: Set myFile = Server.CreateObject("Scripting.FileSystemObject").GetFile("\\server2\myshare\myfile.txt") this fails with an Permission Denied. here's the deal:
3
1394
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 (Windows Authentication). Due to company policy, SQL authentication is not allowed. When a user uses the web page with the Webpart, it should connect to the Database using this Windows Service Account and pull the data for display. When the...
2
1418
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. So my aspnet a/c doesn't match with the Win2k3's aspnet a/c.
0
2257
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 updating the code-behind dll) accessing any aspx page in the application causes the application to run for the first time. Some of the initialization involves reading and writing some text and xml files using simple streamreader and streamwriter...
3
7745
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 services (secure meaning windows authentication credentials must be used to access the web services). The problem is that when the web apps attempt to access a web service they are receiving 401: unathorized. - The apps are all running on web...
2
3801
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, while the SQL Server database is at another PC. The dataset and DataGrid were created successfully. However, when trying to run a Web Form with a table, a server error msg: Login failed for user '(null)'. Reason: Not associated with a trusted...
10
9762
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 returned. So the username and password should be ok. I'm using this code: Merchant myMerch = new Merchant(); myMerch.merchantIdentifier=merchantId;
0
8390
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8819
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8667
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7428
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6222
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4221
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4399
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2048
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.