Building SQL connection string in code-behind file. Works on my machine, not on server.



I wrote an ASP.NET application that queries a SQL Server database (on a
different box from the web server) and displays the result in a GridView.
The datasource for the GridView is a SQLDataSource. Just to get it to work,
I hard-coded the username and password of a SQL Server account in the
connectionstring in web.config. Once I confirmed that this worked on the
web server, I wanted to remove the hard-coded password from web.config, so I
removed that portion of the connectionstring. In the Page_Load procedure of
the page's code-behind file, I then appended the username and password to
the connectionstring in web.config. It worked perfectly on my machine in
Visual Studio.NET 2008. So, I moved the updated code to the web server, but
I got the error, "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'."
What is the problem here?



Thanks for any help you can provide.



Brett


.



Relevant Pages

  • RE: Problems with WebParts
    ... to a database called aspnetdb. ... > The connection string specifies a local SQL Server Express instance using a ... > server account must have read and write access to the applications directory. ... > This is necessary because the web server account will automatically create ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Remote development advice
    ... We are using IIS as the web server. ... The IIS and SQL Server is setup in his ... I want to be able to access the pages that my friend has done remotely ... Then whichever web site he has configured as the default site on IIS should appear, assuming the web server was configured correctly. ...
    (microsoft.public.dotnet.general)
  • Re: SQL2K WIN2K3 CONNECTION SECURITY
    ... My own benchmarking indicates that TCP/IP is faster than named pipes. ... the benchmark stats as the starting point... ... Perfmon and SQL Server Profiler along with SQL Server Query Analyser. ... encrypted on the web server. ...
    (microsoft.public.security)
  • Re: connect to sql server on web server
    ... I want to connect to SQL Server on the web server from my workstation ... My workstation is in the same room as the web server but our network ... as a general networking question. ...
    (microsoft.public.sqlserver.connect)
  • Re: sometimes endless loop, sometimes not
    ... I couldn't afford a hosting with SQL server:) ... and ensure that row level locking isn't being disabled. ... >> to use it on my web server and moved to SQL Server when I started getting ...
    (microsoft.public.data.ado)