Can my ASP.NET dev workstation see remote SQL server?

T

Timo

I would like to develop my ASP.NET application against a SQL 2000 database
residing on another server, rather than against the SQL server installed
locally. We're using Windows integrated security. When I'm using Visual
Studio the ASP.NET user belongs to my XP machine's local domain, which is
not recognized by the remote SQL server as belong to its domain. It is
possible to set up the SQL Server, my local XP machine, or my web.config
file so that when I develop an app in Visual Studio (Debug -> Start), I can
access the remote SQL database?
Thanks !
 
C

Cowboy \(Gregory A. Beamer\)

You should be able to register the server using the format domain\username
and then develop against it. NOTE that, by default, the method of security
is windows and not mixed, but that sounds fine in your case.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
A

Aaron Weiker

Timo said:
I would like to develop my ASP.NET application against a SQL 2000 database
residing on another server, rather than against the SQL server installed
locally. We're using Windows integrated security. When I'm using Visual
Studio the ASP.NET user belongs to my XP machine's local domain, which is
not recognized by the remote SQL server as belong to its domain. It is
possible to set up the SQL Server, my local XP machine, or my web.config
file so that when I develop an app in Visual Studio (Debug -> Start), I can
access the remote SQL database?
Thanks !


In order to have ASP.NET connect to the database server, you must
configure ASP.NET to run as a domain account. I believe it is the
machine.config file that you will need to modify on windows xp to change
what user ASP.NET runs as. It is different on different OSes. The good
thing is that with Windows 2003 you configure it directly in IIS and
each application can run under a different user.
 
J

Jose Marcenaro

You certainly can
A couple of ways to do it (one OR the other)

1) Edit machine.config (C:\WINNT\Microsoft.NET\Framework\v......\Config) and
change the userName / password of the <processModel ..> element as described
in the same file
That way you can run the ASP.NET working process on the identity of a domain
account that may be allowed access to the SQL Server

2) For your Web application (on the IIS console), replace the default
anonymous user (IUSR_xxxxxxx) with a domain user / password and allow access
to that user in the SQL Server. You should also set <identity
impersonate=true> in your Web.config

Regards
Jose.
 
T

Timo

I follow step #1 below (it seems preferable to editing the live IIS server).
On my local PC, I edit the userName element replacing the value with

DOMAIN\USERNAME

This domain user has been granted login on the remote SQL server, has been
granted dbaccess, and has been added as a member of a role which can access
the relevant tables.When I try to run my ASP.NET page, I get the following
error:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection

I don't know what our network admin has done when setting up my PC, which
has XP Pro on it; he is used to Win2K. He knows only a little more than I do
about Windows authentication, which has me worried :) Why does the error
message have 'null' for the username? Because SQL does not recognize it and
so refuses to repeat the name?
Thanks
Timo
 
T

Timo

Thanks for responding. But I don't know what is meant by "register the
server". Is that something I do with Visual Studio.NET? Do I need a special
"enterprise" level of VS.NET for that?
Timo
 
J

Jose Marcenaro

If you want to use step #1 (ASPNET account) make sure you dont have
<impersonate="true"> in Web.config (you should keep the default which is
false or absent).
Otherwise, the local IUSR_xxxxx identity would be used.

If you do not currently have <impersonate="true"> ... then I guess it may be
some "extra-cautious" security setting of XPPro which prevents the identity
to be passed along.. sorry for not being able to help there
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top