CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2000
    Posts
    129

    WebService cannot connect to a remote SQL Database.

    I have an ASP.NET Web Service and I’m trying to connect to a database on a remote machine (MS SQL Server on 2003 Windows Server machine). I added a ASPNET account to Windows and to SQL Server but it doesn’t work and gives me an exception: “Server doesn’t exist or access denied”.

    At the same time I can easily connect to this database from a regular C# application.

    Please help!!!

  2. #2

    Re: WebService cannot connect to a remote SQL Database.

    Check your connect string. Remember that a [web]service doesn't run as a typical user account. Your normal app may work due to you being logged in and running the db connection off your credentials. For ASP.NET, it's typically the ASP.NET account or the NETWORK SERVICE, or possibly LOCALSYSTEM depending on your setup. Otherwise, use SQL Authentication.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured