Building SQL connection string in code-behind file. Works on my machine, not on server.
- From: "Brett" <brettlf@xxxxxxxxxxxxxxxx>
- Date: Tue, 29 Jul 2008 15:41:04 -0400
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
.
- Follow-Ups:
- Prev by Date: Re: How to get image from Webbrowser page
- Next by Date: Re: PasswordRecovery and clear password sent to users
- Previous by thread: Changing the Oracle server where a DataTable points to
- Next by thread: Re: Building SQL connection string in code-behind file. Works on my machine, not on server.
- Index(es):
Relevant Pages
|