p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

aspdotnet_website_programming thread: SQL Connection


Message #1 by priede01@s... on Tue, 25 Feb 2003 16:20:47
I am trying to connect to a SQL server.
I can connect using ADO.net in a VB.net application.
Here is my connection string:
dim con as new Sqlconnection("Data Source=SP4578; Integrated 
Security=SSPI;Initial Catalog=ProductTesting")

I am getting an error that says Login failed for user '(null)'. Reason: 
Not associated with a trusted SQL Server connection.

I read that if you use Integrated Security=SSPI in the connection string 
then the connection will use Windows NT authentication to connect.

What is wrong?

Thanks for your help!
Message #2 by "ksh pandey" <k****ij_jbp_2001@r...> on 26 Feb 2003 03:49:58 -0000
Hi

Get to this link
http://www.mvps.org/windev/security/sspi.html

it may solve ur probleem


Regards
K****ij Pandey


On Tue, 25 Feb 2003 priede01@s... wrote :
>I am trying to connect to a SQL server.
>I can connect using ADO.net in a VB.net application.
>Here is my connection string:
>dim con as new Sqlconnection("Data Source=SP4578; Integrated
>Security=SSPI;Initial Catalog=ProductTesting")
>
>I am getting an error that says Login failed for user '(null)'. 
>Reason:
>Not associated with a trusted SQL Server connection.
>
>I read that if you use Integrated Security=SSPI in the connection 
>string
>then the connection will use Windows NT authentication to 
>connect.
>
>What is wrong?
>
>Thanks for your help!
>---
>Professional Design Patterns in VB.NET:
>Building Adaptable Applications
>
>Want to know how design patterns bring reusable
>design and adaptabilty to your applications? How
>to recognize the need for a design pattern
>solution? How to select, design, and implement
>the right patterns? How parts of the .NET Framework
>(like the .NET Data Providers and .NET Remoting)
>take advantage of design patterns? This book
>presents a practical approach to using design
>patterns in VB.NET, by focusing on the relevance
>of design patterns in the different tiers of a
>distributed n-tier architecture.
>
>http://www.wrox.com/books/1861006985.htm
>




Message #3 by "Riede, Doug D [PCS]" <priede01@s...> on Wed, 26 Feb 2003 07:35:33 -0600
I think I found the problem it lies in the SQL Server. When I setup the
server I choose Windows Authentication and not mix mode. I believe that I
need to pick Mix mode to use for connections coming across the internet. 

Thank you,
Doug Riede
Product Planning & Strategy
Subscriber Equipment
xxx-xxx-xxxx
Sprint PCS



-----Original Message-----
From: ksh pandey [mailto:k****ij_jbp_2001@r...]
Sent: Tuesday, February 25, 2003 9:50 PM
To: Website Programming with ASP.NET
Subject: [aspdotnet_website_programming] Re: SQL Connection


Hi

Get to this link
http://www.mvps.org/windev/security/sspi.html

it may solve ur probleem


Regards
K****ij Pandey


On Tue, 25 Feb 2003 priede01@s... wrote :
>I am trying to connect to a SQL server.
>I can connect using ADO.net in a VB.net application.
>Here is my connection string:
>dim con as new Sqlconnection("Data Source=SP4578; Integrated
>Security=SSPI;Initial Catalog=ProductTesting")
>
>I am getting an error that says Login failed for user '(null)'. 
>Reason:
>Not associated with a trusted SQL Server connection.
>
>I read that if you use Integrated Security=SSPI in the connection 
>string
>then the connection will use Windows NT authentication to 
>connect.
>
>What is wrong?
>
>Thanks for your help!
>---
>Professional Design Patterns in VB.NET:
>Building Adaptable Applications
>
>Want to know how design patterns bring reusable
>design and adaptabilty to your applications? How
>to recognize the need for a design pattern
>solution? How to select, design, and implement
>the right patterns? How parts of the .NET Framework
>(like the .NET Data Providers and .NET Remoting)
>take advantage of design patterns? This book
>presents a practical approach to using design
>patterns in VB.NET, by focusing on the relevance
>of design patterns in the different tiers of a
>distributed n-tier architecture.
>
>http://www.wrox.com/books/1861006985.htm
>





---
Professional Design Patterns in VB.NET: 
Building Adaptable Applications

Want to know how design patterns bring reusable 
design and adaptabilty to your applications? How 
to recognize the need for a design pattern 
solution? How to select, design, and implement 
the right patterns? How parts of the .NET Framework 
(like the .NET Data Providers and .NET Remoting) 
take advantage of design patterns? This book 
presents a practical approach to using design 
patterns in VB.NET, by focusing on the relevance 
of design patterns in the different tiers of a 
distributed n-tier architecture. 

http://www.wrox.com/books/1861006985.htm

Message #4 by "Ken Schaefer" <ken@a...> on Thu, 27 Feb 2003 15:05:01 +1100
You don't have to.

However, the ASPNet account is local to the webserver, and if your SQL
Server is on a remote box then the webserver's ASPNet account can't be
granted permissions to the remote box (because it is a local account).

Instead:
a) change the process model in machine.config (or identity in web.config) to
use a domain account
-or-
b) enable impersonation in web.config (do not set a username/password) and
set the anonymous internet user account in IIS MMC Snapin to a domain
account

Give the domain account permission to login to the remote SQL Server.

Cheers
Ken

PS Please trim the very long, and unnecessary footers from the bottom of
your posts.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Riede, Doug D [PCS]" <priede01@s...>
Subject: [aspdotnet_website_programming] Re: SQL Connection


: I think I found the problem it lies in the SQL Server. When I setup the
: server I choose Windows Authentication and not mix mode. I believe that I
: need to pick Mix mode to use for connections coming across the internet.
:
: Thank you,
: Doug Riede
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<snip>


  Return to Index