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

Error connecting to SQL Server through a Web Service???

I'm trying to connect my application with a web service located on my own web
server(localhost).

I guess when the solution/proect is built it makes a file called 'Web
References\localhost\References.vb'

In this file a line of code reports the following error:

Line of code:
Dim results() As Object = Me.Invoke("GetCustomers", New Object() {Country})

Error:
An unhandled exception of type 'System.Web.Services.Protocols.SoapException'
occurred in system.web.services.dll

Additional information: Server was unable to process request. --> Login
failed for user 'myserver\ASPNET'.

My WebService is trying to connect and execute a query on MS SQL Server
database.

What is causing this error?
Login failed for user '......

Where is the 'ASPNET' comming from in the login failed for user
'myserver\ASPNET'?

--
Sincerely,

Keith
Nov 21 '05 #1
3 3708
GTDriver wrote:
What is causing this error?
Login failed for user '......
Where is the 'ASPNET' comming from in the login failed for user
'myserver\ASPNET'?


Looks like your SqlConnection string is setup to use Windows authentication.
The ASP.NET worker process runs as that account that you're seeing. Therefore
if you need your web service application to login to the database using Windows
authentication you need to permit yourdomain\ASPNET to the database (I suggest
with very low permissions) or you need to change your web service application
to run as a different Windows user (all kinds of security considerations
to make there). I usually use the latter, but you just need to be very careful
what rights you grant that account.

As another option, you can change your connection string to use SQL authentication
(which has it's own considerations).

HTH,
Drew

___________________________________
Drew Marsh
Chief Software Architect
Mimeo, Inc. - http://www.mimeo.com
Weblog - http://blog.hackedbrain.com

Nov 21 '05 #2
Drew - Thanks , I added ASPNET user to the database and it worked fine.

However, I noticed when I try to use this webservice, I have to be connected
to the internet. This webservice is on my local machine( the webserver on my
Win2K profesional pc). I'm not trying to get any ohter info other than
connect to SQL Server database and return the query.

Why do I have to be connected to the Internet for this to work?

Thanks,

Keith

"Drew Marsh" wrote:
GTDriver wrote:
What is causing this error?
Login failed for user '......
Where is the 'ASPNET' comming from in the login failed for user
'myserver\ASPNET'?


Looks like your SqlConnection string is setup to use Windows authentication.
The ASP.NET worker process runs as that account that you're seeing. Therefore
if you need your web service application to login to the database using Windows
authentication you need to permit yourdomain\ASPNET to the database (I suggest
with very low permissions) or you need to change your web service application
to run as a different Windows user (all kinds of security considerations
to make there). I usually use the latter, but you just need to be very careful
what rights you grant that account.

As another option, you can change your connection string to use SQL authentication
(which has it's own considerations).

HTH,
Drew

___________________________________
Drew Marsh
Chief Software Architect
Mimeo, Inc. - http://www.mimeo.com
Weblog - http://blog.hackedbrain.com/

Nov 21 '05 #3
How is your network connection managed? The calls to SQL server can go
over either TCP/IP or over named pipes. If your SQL client is configured
for TCP/IP, then you need a valid network connection to talk to SQL Server.

I hope this helps

Dan Rogers
Microsoft Corporation
--------------------
Thread-Topic: Error connecting to SQL Server through a Web Service???
thread-index: AcTX3tYEVMW3Zl0ETZOgKNJRjwF+vw==
X-WBNR-Posting-Host: 4.158.243.47
From: "=?Utf-8?B?R1REcml2ZXI=?=" <GT******@discussions.microsoft.com>
References: <C5**********************************@microsoft.co m>
<85*********************@msnews.microsoft.com>
Subject: Re: Error connecting to SQL Server through a Web Service???
Date: Wed, 1 Dec 2004 11:49:14 -0800
Lines: 44
Message-ID: <01**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.webservices:7727
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Drew - Thanks , I added ASPNET user to the database and it worked fine.

However, I noticed when I try to use this webservice, I have to be
connected
to the internet. This webservice is on my local machine( the webserver on
my
Win2K profesional pc). I'm not trying to get any ohter info other than
connect to SQL Server database and return the query.

Why do I have to be connected to the Internet for this to work?

Thanks,

Keith

"Drew Marsh" wrote:
GTDriver wrote:
What is causing this error?
Login failed for user '......
Where is the 'ASPNET' comming from in the login failed for user
'myserver\ASPNET'?
Looks like your SqlConnection string is setup to use Windows

authentication. The ASP.NET worker process runs as that account that you're seeing. Therefore if you need your web service application to login to the database using Windows authentication you need to permit yourdomain\ASPNET to the database (I suggest with very low permissions) or you need to change your web service application to run as a different Windows user (all kinds of security considerations
to make there). I usually use the latter, but you just need to be very careful what rights you grant that account.

As another option, you can change your connection string to use SQL authentication (which has it's own considerations).

HTH,
Drew

___________________________________
Drew Marsh
Chief Software Architect
Mimeo, Inc. - http://www.mimeo.com
Weblog - http://blog.hackedbrain.com/


Nov 21 '05 #4

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

Similar topics

1
by: Marcos | last post by:
Yesterday afternoon I lost access to my local MSDE 2000 sp3(a?) instance. Usinig NT or SQL authentication I get an 'access denied' error when I try to connect. This happened suddenly with no...
0
by: AA | last post by:
This mail is regarding a trouble I'm facing with SQL Server 2000. I'm working with ASP .NET V 1.1 and SQL Server 2000. I have a reporting module that generates XML reports from the SQL Server 2000...
12
by: Ann Marinas | last post by:
Hi all, I would like to ask for some help regarding separating the asp.net webserver and the sql server. I have created an asp.net application for a certain company. Initially, we installed...
4
by: coosa | last post by:
Hi, I was installing SQL Server on my machine and during installation my PC freezed. It happens frequently on my machine. So i tried after restarting to install it again and since then i always...
1
by: John Shadel | last post by:
I have the following setup: 1. ASP.NET 2.0 web app hosted on a web server (inetpub directory hosting physical files of the web site on a different drive name, E: than the SQL Server Instance,...
2
by: RdS | last post by:
Hello, I use sourcesafe and vb 2003 for my dev environment. on the sourcesafe server I also have sql2005 and reporting services installed. The web app references this sql server for db. When...
10
by: mairhtin o'feannag | last post by:
Hello, I'm having problems connecting to my new v9 db box. The pertinent information is below: DB2_db2inst1 60000/tcp DB2_db2inst1_1 60001/tcp DB2_db2inst1_2 60002/tcp DB2_db2inst1_END...
2
by: SayamiSuchi | last post by:
-------------------------------------------------------------------------------- Hi, I have made one web application using Asp dot net 2005 and sql server 2005.The sql server i am connecting is...
13
by: AAaron123 | last post by:
I downloaded the personal website starter kit and when I run it I get the error shown below. I found a way of using Launch Surface Area Configuration that is supposed to fix the remote setting...
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
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
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.