Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Connection to SQL fails, OK from ASP and VS.NET

Reply
Thread Tools

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

 
 
Tom Kaminski [MVP]
Guest
Posts: n/a
 
      11-06-2003
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/



 
Reply With Quote
 
 
 
 
tropico
Guest
Posts: n/a
 
      11-06-2003
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)?


 
Reply With Quote
 
 
 
 
Tom Kaminski [MVP]
Guest
Posts: n/a
 
      11-06-2003
"Tom Kaminski [MVP]" <tomk (A@T) mvps (D.O.T) org> wrote in message
news:bodje3$...
> 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/



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Reference, SQL Queries, SQL help ecoolone ASP .Net 0 01-03-2008 10:58 AM
How to perform cleanup for javax.sql.DataSource, like we do for java.sql.Connection HalcyonWild Java 2 12-19-2005 08:54 AM
asp and sql statement in sql server db weiwei ASP General 3 09-22-2004 04:12 PM
How to read an SQL Server into a ASP page and then change, add, delete and write it back to SQL Server Belinda ASP General 4 06-11-2004 12:16 PM
Trusted connection doesn't work with SQL server and ASP.Net Peter Afonin ASP .Net 1 08-29-2003 03:05 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57