473,467 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Accessing SQL server using ASP .NET

Hi,

I have written a sample ASP .NET application to connect to a SQL Server box
that uses Windows authentication ( i guess it was installed by the server
guys that way). In my web.config page I have used these configuration
parameters
<authentication mode="Windows" />
<identity impersonate="true"/>

<authorization>
<allow users="*" />

<appSettings>
<add key="SQL_DB_CONNECTION" value="SQL123" initial
catalog=Sample;integrated security=SSPI;persist security info=False;
Trusted_Connection=Yes" />

</appSettings>

Now when I run the application it gives me an Connection/Configuration Error
authorization failed for "NT\anonymous" user... why?

I went to IIS and for the application and removed the "anoymous access
login" and the application works....

How can I make the application accessible by anonymous users?

thanks,
Stephen.
Nov 19 '05 #1
4 995
you'll have to assign the user in IIS as a valid SQL/Domain user, and not
the IUSR account

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Stephen" <st*********@hotmail.com> wrote in message
news:ur***************@TK2MSFTNGP12.phx.gbl...
Hi,

I have written a sample ASP .NET application to connect to a SQL Server
box
that uses Windows authentication ( i guess it was installed by the server
guys that way). In my web.config page I have used these configuration
parameters
<authentication mode="Windows" />
<identity impersonate="true"/>

<authorization>
<allow users="*" />

<appSettings>
<add key="SQL_DB_CONNECTION" value="SQL123" initial
catalog=Sample;integrated security=SSPI;persist security info=False;
Trusted_Connection=Yes" />

</appSettings>

Now when I run the application it gives me an Connection/Configuration
Error
authorization failed for "NT\anonymous" user... why?

I went to IIS and for the application and removed the "anoymous access
login" and the application works....

How can I make the application accessible by anonymous users?

thanks,
Stephen.

Nov 19 '05 #2
in the web config, see the <impersonate> settings. set a userName and
password. note: asp.net supports using encrypted registery values for
security.

-- bruce (sqlwork.com)

"Stephen" <st*********@hotmail.com> wrote in message
news:ur***************@TK2MSFTNGP12.phx.gbl...
| Hi,
|
| I have written a sample ASP .NET application to connect to a SQL Server
box
| that uses Windows authentication ( i guess it was installed by the server
| guys that way). In my web.config page I have used these configuration
| parameters
| <authentication mode="Windows" />
| <identity impersonate="true"/>
|
| <authorization>
| <allow users="*" />
|
| <appSettings>
| <add key="SQL_DB_CONNECTION" value="SQL123" initial
| catalog=Sample;integrated security=SSPI;persist security info=False;
| Trusted_Connection=Yes" />
|
| </appSettings>
|
| Now when I run the application it gives me an Connection/Configuration
Error
| authorization failed for "NT\anonymous" user... why?
|
| I went to IIS and for the application and removed the "anoymous access
| login" and the application works....
|
| How can I make the application accessible by anonymous users?
|
| thanks,
| Stephen.
|
|
Nov 19 '05 #3
Ooo... yeah, or do that :}

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"bruce barker" <no***********@safeco.com> wrote in message
news:e7**************@TK2MSFTNGP12.phx.gbl...
in the web config, see the <impersonate> settings. set a userName and
password. note: asp.net supports using encrypted registery values for
security.

-- bruce (sqlwork.com)

"Stephen" <st*********@hotmail.com> wrote in message
news:ur***************@TK2MSFTNGP12.phx.gbl...
| Hi,
|
| I have written a sample ASP .NET application to connect to a SQL Server
box
| that uses Windows authentication ( i guess it was installed by the
server
| guys that way). In my web.config page I have used these configuration
| parameters
| <authentication mode="Windows" />
| <identity impersonate="true"/>
|
| <authorization>
| <allow users="*" />
|
| <appSettings>
| <add key="SQL_DB_CONNECTION" value="SQL123" initial
| catalog=Sample;integrated security=SSPI;persist security info=False;
| Trusted_Connection=Yes" />
|
| </appSettings>
|
| Now when I run the application it gives me an Connection/Configuration
Error
| authorization failed for "NT\anonymous" user... why?
|
| I went to IIS and for the application and removed the "anoymous access
| login" and the application works....
|
| How can I make the application accessible by anonymous users?
|
| thanks,
| Stephen.
|
|

Nov 19 '05 #4
If you are running IIS 6, you can create an application pool and set the
identity to a user that has access rights to the sql server. Then put your
asp.net application into that application pool.

"Curt_C [MVP]" wrote:
Ooo... yeah, or do that :}

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"bruce barker" <no***********@safeco.com> wrote in message
news:e7**************@TK2MSFTNGP12.phx.gbl...
in the web config, see the <impersonate> settings. set a userName and
password. note: asp.net supports using encrypted registery values for
security.

-- bruce (sqlwork.com)

"Stephen" <st*********@hotmail.com> wrote in message
news:ur***************@TK2MSFTNGP12.phx.gbl...
| Hi,
|
| I have written a sample ASP .NET application to connect to a SQL Server
box
| that uses Windows authentication ( i guess it was installed by the
server
| guys that way). In my web.config page I have used these configuration
| parameters
| <authentication mode="Windows" />
| <identity impersonate="true"/>
|
| <authorization>
| <allow users="*" />
|
| <appSettings>
| <add key="SQL_DB_CONNECTION" value="SQL123" initial
| catalog=Sample;integrated security=SSPI;persist security info=False;
| Trusted_Connection=Yes" />
|
| </appSettings>
|
| Now when I run the application it gives me an Connection/Configuration
Error
| authorization failed for "NT\anonymous" user... why?
|
| I went to IIS and for the application and removed the "anoymous access
| login" and the application works....
|
| How can I make the application accessible by anonymous users?
|
| thanks,
| Stephen.
|
|


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jaydeep | last post by:
Hello, I am facing a strange problem. Problem accessing remote database from ASP using COM+ server application having VB components (ActiveX DLL) installed. Tier 1 : ASP front End (IIS 5.0) Tire...
1
by: Amy Tseng | last post by:
Hi, I am having a problem accessing SQL Server 2000 via UNIX. I am accessing SQL Server 2000 from Solaris using Sybase Open Client (CT-Lib). Here is the error message: CT-LIBRARY error:...
23
by: Lamberti Fabrizio | last post by:
Hi all, I've to access to a network file from an asp pages. I've red a lot of things on old posts and on Microsoft article but I can't still solve my problem. I've got two server inside the...
3
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
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...
5
by: Daniel Corbett | last post by:
I am trying to save a file dynamically created in a webpage. I get the following headers, but cannot figure out how to save the attachment. I am basically trying to replicate what internet...
4
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
0
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
4
by: Noy B | last post by:
Hi, I have developed a small application that is using a MSAccess DB. the problem is that it was developed on a machine where the application and the DB are both located. now it needs to be...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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,...
1
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...
0
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...

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.