I believe that you are running into a problem with delegation. If you are
unfamiliar with this concept, please review this link since Keith Brown can
explain it far better than I can:
http://www.pluralsight.com/wiki/default.aspx/Keith.GuideBook/WhatIsDelegation.html
Unless you have changed the defaults, your web server is probably running as
ASPNET (pre-Server 2003), or as Network Service (Server 2003). Based upon
your connection strings, it looks like you are trying to use Windows
Authentication / Integrated Security, which means that either ASPNET or
Network Service is the identity that you are using to access your database
server. If this is true, then you need to grant the ASPNET identity from
your web server access to SQL Server.
It is also possible that you are trying to use web.config to impersonate
another identity. However, unless you are using Server 2003 and enabling
delegation (this feature is not available in earlier versions of Windows),
then your impersonation is only valid on your web server. You are not
allowed to use an impersonated identity to access a remote machine, such as
your database server. If you want to do this, make sure that you are using
Windows Server 2003 and turn this feature on for your web application.
If you have everything set up properly, try this connection string for
integrated security:
Provider=SQLOLEDB.1;Integrated Security=SSPI;Data Source=<server>;Initial
Catalog=<database>;
I'm not 100% sure of the correct syntax for the <server> if you need to
specify a non-default port, but I'd try standard TCP/IP syntax first:
"10.16.175.255:1234".
A much simpler solution would be to simply use SQL Server authentication.
Simply pass your user id & password (without any of the Integrated Security
parameters) in your connection string. This will not be as secure as
Windows authentication, but it will work across servers.
This connection string should work for SQL Server authentication:
Provider=SQLOLEDB.1;User ID=<userid>;Data
Source=<server>;Pwd=<password>;Initial Catalog=<database>;
Hopefully this will put you on the right track.
- Erik Wynne Stepp