473,387 Members | 1,859 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,387 software developers and data experts.

Connection to SQL fails, OK from ASP and VS.NET

My SQLConnection fails from an aspx using Basic authentication and an
integrated authentication connection string. An ASP in the same folder
works 100% OK and I am also able to connect to and work with the database
using my Windows account through Visual Studio 2003 as well as SQL
Enterprise Manager - so it seems as though permissions are configured
correctly on the DB.

Here's my error message:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

Here's my connection string:
data source=mySQLserver;initial catalog=WEB_USAGE_DEV_DB;Integrated
Security=True;workstation id=ASP_NET

What am I missing? Why isn't the aspx/IIS sending my credentials to SQL
Server (when an ASP in the same folder with the same connection string is)?

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Nov 17 '05 #1
2 993
On Thu, 06 Nov 2003 08:51:05 -0500, Tom Kaminski [MVP] wrote:
Your mixing 2 things here. The user who access the web site and the user
used by your application.

If your using Trusted_Connection you have to allow the user
MACHINENAME\ASPNET on your database. Your application is running under
this user by default.

If your working with Windows 2003 is the user NT AUTHORITY\NETWORK
SERVICE wich is used.

The other possibnility is to specified "user id" and "password" in
connection string.

My SQLConnection fails from an aspx using Basic authentication and an
integrated authentication connection string. An ASP in the same folder
works 100% OK and I am also able to connect to and work with the database
using my Windows account through Visual Studio 2003 as well as SQL
Enterprise Manager - so it seems as though permissions are configured
correctly on the DB.

Here's my error message:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

Here's my connection string:
data source=mySQLserver;initial catalog=WEB_USAGE_DEV_DB;Integrated
Security=True;workstation id=ASP_NET

What am I missing? Why isn't the aspx/IIS sending my credentials to SQL
Server (when an ASP in the same folder with the same connection string is)?


Nov 17 '05 #2
"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:bo**********@kcweb01.netnews.att.com...
My SQLConnection fails from an aspx using Basic authentication and an
integrated authentication connection string. An ASP in the same folder
works 100% OK and I am also able to connect to and work with the database
using my Windows account through Visual Studio 2003 as well as SQL
Enterprise Manager - so it seems as though permissions are configured
correctly on the DB.

Here's my error message:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

Here's my connection string:
data source=mySQLserver;initial catalog=WEB_USAGE_DEV_DB;Integrated
Security=True;workstation id=ASP_NET

What am I missing? Why isn't the aspx/IIS sending my credentials to SQL
Server (when an ASP in the same folder with the same connection string

is)?

Never mind ...

I had to add:
<identity impersonate="true"/>

To my web.config file under the <system.web> section.

I found my answer after searching this group through google ...

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Nov 17 '05 #3

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

Similar topics

1
by: mdurliSPAMFILTER | last post by:
Hello, I developed a win32 .exe CGI that connects to a clustered SQLServer to report some data. The software is written with Borland C++Builder. This is the oledb string:...
16
by: peshekeedweller | last post by:
Using asp.net 1.1. vb.net 2003. I am trying to connect to a remote sql server 2000 on a virtual machine running windows 2000 server. I can connect through the server explorer in visual studio,...
4
by: tangokilo | last post by:
Hi I published the problem below some days earlier in xxx.dotnet.languages.vb.data and got no response. So I try here, maybe someone can help me! When developing on stand alone PC using VB...
3
by: MattM | last post by:
I am getting the "The underlying connection was closed: Unable to connect to the remote server" message when trying to connect an ASPX page to a simple Hello World web service. I have read a few...
0
by: gm | last post by:
Immediately after generating the Access application from the Source Safe project I get: "-2147467259 Could not use ''; file already in use." If Access database closed and then reopened I get:...
0
by: Christopher H. Laco | last post by:
I'm in a strange situation. I have a dataset that uses it own connection string from MySettings. All is well. This thing works in .NET just dandy. If I reference this dataset from another...
0
by: Apu Nahasapeemapetilon | last post by:
Why do I get the following two error messages, intermittently, when I issue a "SendRequestResponse(methodName, requestEnvelope);" command on a class derived from...
6
by: Bjoern Schliessmann | last post by:
Hello, I'm currently trying to implement a simulation program with Kamaelia and need a reliable TCP connection to a data server. From Twisted, I know that a method is called if the connection...
1
by: ErikJL | last post by:
I have a simple webservice that performs a SELECT query against a database, and then an INSERT statement on the same database/table. The problem arises at the time when we create the second OleDB...
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.