Sunday, February 12, 2012

ASP.NET and SQL Server

Hello.
I have an asp.net application which currently connects to a local instance
of sql server without any issue.
When I connect to a remote sql server (same database and userid and password
are valid) there is an error indicating 'access denied.' But, when the same
code and connection strings are run on the remote server (along with the
database) the application works fine.
Connection String
user id=UserName;password=password,data source=datasource;initial
catalog=dbName
datasource\ASPNET has been added to the sql server as a user.
Any ideas? I'm using SQL Authentication and ASP.NET 1.1
Does ASP.NET run under another account when accessing a remote server?
Thanks.a) look up SetSpn
b) look up 'trust for delegation'
I bitched up a storm about this at microsoft; they don't publish this
information anywhere.
it pissed me off sooooo bad.
it's like some secret squirrel functionality in Active Directory.
-Aaron
mojo wrote:
> Hello.
> I have an asp.net application which currently connects to a local instance
> of sql server without any issue.
> When I connect to a remote sql server (same database and userid and passwo
rd
> are valid) there is an error indicating 'access denied.' But, when the sam
e
> code and connection strings are run on the remote server (along with the
> database) the application works fine.
> Connection String
> user id=UserName;password=password,data source=datasource;initial
> catalog=dbName
> datasource\ASPNET has been added to the sql server as a user.
> Any ideas? I'm using SQL Authentication and ASP.NET 1.1
> Does ASP.NET run under another account when accessing a remote server?
> Thanks.|||Since you use Username/Password pair (meaning the SQL Server's
authentication mode is mixed mode), it does not matter if you add
MachineName\ASPNET user account as a login/user to the SQL Server/database.
The other posted reply also make no sense to your problem.
Which version of QL Server do you use? SQL Server2000 or 2005? I'd look into
two things:
1. Is remote access to the SQL Server enabled? by default installation
(especially if it is SQL Server2005/Express), remote access is disabled. You
nned to explicitly enable remote access to it;
2. Double-check to make sure the SQL Server's authentication mode is mixed
mode. Again. by default installation, SQL Server uses Windows Authentication
mode (If your app indeed worked on the same computer as the SQL Server, with
the given user name and password in connectionString, then you do not need
make this check, unless the remote SQL Server is not the same SQL Server you
have tested on the same computer).
"mojo" <mojo@.discussions.microsoft.com> wrote in message
news:52A09F8F-BC9B-4DFE-B004-3D406F0B5760@.microsoft.com...
> Hello.
> I have an asp.net application which currently connects to a local instance
> of sql server without any issue.
> When I connect to a remote sql server (same database and userid and
> password
> are valid) there is an error indicating 'access denied.' But, when the
> same
> code and connection strings are run on the remote server (along with the
> database) the application works fine.
> Connection String
> user id=UserName;password=password,data source=datasource;initial
> catalog=dbName
> datasource\ASPNET has been added to the sql server as a user.
> Any ideas? I'm using SQL Authentication and ASP.NET 1.1
> Does ASP.NET run under another account when accessing a remote server?
> Thanks.
>|||Hello,
Yes, I did double check that and it is in mixed mode. I'm running SQL Server
2000 on Windows XP & ASP.NET 1.1.
Regarding remote access, where is that in SQL 2000? I don't believe I've ran
into that setting before. Do you mind pointing me in the direction of where
I
can find it?
Thanks
"Norman Yuan" wrote:

> Since you use Username/Password pair (meaning the SQL Server's
> authentication mode is mixed mode), it does not matter if you add
> MachineName\ASPNET user account as a login/user to the SQL Server/database
.
> The other posted reply also make no sense to your problem.
> Which version of QL Server do you use? SQL Server2000 or 2005? I'd look in
to
> two things:
> 1. Is remote access to the SQL Server enabled? by default installation
> (especially if it is SQL Server2005/Express), remote access is disabled. Y
ou
> nned to explicitly enable remote access to it;
> 2. Double-check to make sure the SQL Server's authentication mode is mixed
> mode. Again. by default installation, SQL Server uses Windows Authenticati
on
> mode (If your app indeed worked on the same computer as the SQL Server, wi
th
> the given user name and password in connectionString, then you do not need
> make this check, unless the remote SQL Server is not the same SQL Server y
ou
> have tested on the same computer).
> "mojo" <mojo@.discussions.microsoft.com> wrote in message
> news:52A09F8F-BC9B-4DFE-B004-3D406F0B5760@.microsoft.com...
>
>|||check
sp_configure sysytem stored procedure.
I think it might require a restart for the changes to take effect.
-Omnibuzz (The SQL GC)
http://omnibuzz-sql.blogspot.com/|||ok, I checked Remote Access and it was already set to true.
Any ideas if this issue is related to version of install (Personal v
Standard v Enterprise Edition)?
"Omnibuzz" wrote:

> check
> sp_configure sysytem stored procedure.
> I think it might require a restart for the changes to take effect.
> -Omnibuzz (The SQL GC)
> http://omnibuzz-sql.blogspot.com/
>|||Can you connect to the said SQL Server from other computers at all (you can
try to access the SQL Server from other computer by creating ODBC data
source on these computers, or create a data link file (blank text file with
extension *.udl).
If you can, then it is the problem of your ASP.NET app (assume the network
cable/hub... hardware are OK. Have you checked them?), if you cannot, it is
the problem of the SQL Server configuration.
"mojo" <mojo@.discussions.microsoft.com> wrote in message
news:D4B879EE-7CBE-4A7F-B0AD-C10DDE16685D@.microsoft.com...
> Hello,
> Yes, I did double check that and it is in mixed mode. I'm running SQL
> Server
> 2000 on Windows XP & ASP.NET 1.1.
> Regarding remote access, where is that in SQL 2000? I don't believe I've
> ran
> into that setting before. Do you mind pointing me in the direction of
> where I
> can find it?
> Thanks
> "Norman Yuan" wrote:
>

No comments:

Post a Comment