473,466 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ADO DB Connection to SQL Server (ASP.Net)

I'm attempting to connect to a SQL Server DB, using ADO, from my new ASP.NET
web application. I can use the same connect string from within a VB.Net app
(windows app) just fine, but I cannot do it from within my web app... Here
is the error I am receiving:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

I am using windows authentication, which works just fine within my windows
app - I'm using the web server on my local machine... Here is my connect
string and code associated with this:

sDatabaseType = "SQL Server"
sServerName = "MyServer"
sDatabaseName = "MyDatabase"sConnectString = "DRIVER={SQL
Server};SERVER=" & sServerName & ";Trusted_connection=yes;DATABASE=" &
sDatabaseName & ";"
gdcDataConnection = New ADODB.Connection
gdcDataConnection.Open(sConnectString)

I would appreciate any help that you can provide!!!!!
Thank you!-Valerie
Nov 21 '05 #1
2 3212
Krdev.

This problem is almost forever that the user for a webserver application is
the ASPNET or the IIS user. And need therefore the rights on the database
that you use confirm that.

I hope this helps,

Cor
Nov 21 '05 #2
ASP .Net application is runnig under "ASPNET" account for IIS 5 and Network
Services in IIS 6. While Windows appliations are running under the current
user account.
So what you need is add access persissions on the server, database, table,
views, stored prcedures for the ASPNET or the Network Services account

I hope this helps

"kvrdev1" wrote:
I'm attempting to connect to a SQL Server DB, using ADO, from my new ASP.NET
web application. I can use the same connect string from within a VB.Net app
(windows app) just fine, but I cannot do it from within my web app... Here
is the error I am receiving:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.

I am using windows authentication, which works just fine within my windows
app - I'm using the web server on my local machine... Here is my connect
string and code associated with this:

sDatabaseType = "SQL Server"
sServerName = "MyServer"
sDatabaseName = "MyDatabase"sConnectString = "DRIVER={SQL
Server};SERVER=" & sServerName & ";Trusted_connection=yes;DATABASE=" &
sDatabaseName & ";"
gdcDataConnection = New ADODB.Connection
gdcDataConnection.Open(sConnectString)

I would appreciate any help that you can provide!!!!!
Thank you!-Valerie

Nov 21 '05 #3

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

Similar topics

17
by: AMC | last post by:
Hi, I'm using an include file to store the connection string to a database. Whenever I try to reference that string to open a connection in the page that includes the file I get the error 'empy...
4
by: Mark | last post by:
OK. Here we go. I have an ASP.NET application that does many hits to a SQL Server DB on a separate server. When I first created this application (2 years ago) and was very new to ASP/ASP.NET, to...
18
by: WStoreyII | last post by:
I am making a asp page that will run on my computer by iis. But the problem is the database in on a web server. I can not seem to get the connection to work for it though here his the connection...
6
by: Mike L. | last post by:
Hi, Pls, beware that I'm new to this :) I've developed several web appl, either with ASP or ASP.NET. All using SQL server as the back end. In my development environment, I have a single...
7
by: Keith Norris | last post by:
I cannot successfully create a connection object in a web form. In the page_load event I try the following code: Dim sConnection As String = "server=MIDATLANTICUS;" & _ database=Pubs;integrated...
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,...
6
by: jonefer | last post by:
I have two versions of a 'Downtime Application that will run in the event that the mainframe goes down 1) SQL Server ASP.NET app (accessed outside the mainframe network) 2) MS Access Version of...
2
by: hfk0 | last post by:
Hi, I have a simple asp.net application running ok on my WinXP development server with SQL Server Express 2005 installed locally. After moving to the live server (Win 2000 server with MSDE 2000...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
5
by: OJ | last post by:
Hi, I am at a loss here, I have a c# asp.net website which connects to a remote SQL Server 2000 db via a connection string. If I set the website up in the filesystem and use the inbuilt cassini...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.