472,371 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 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 3612
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

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.