G
Greg Bahns
I am having a strange problem connecting to a SQL Server 2000 database from
an ASP.NET application.
The strange thing is that I can connect fine using ADODB in an old-fashioned
ASP application, but I get the message "SQL Server does not exist or access
denied" when I try to connect using the SqlConnection object in an ASP.NET
C# application running on the same machine.
The database is SQL Server 2000 running on Windows Server 2003, and the
development machine is running Windows XP with VS.NET 2003, .NET Framework
1.1.
The database server is named "mydbserver", and the developer machine is
named "mywebserver".
Here is the connection string from the old ASP application:
Provider=SQLOLEDB;Server=mydbserver;Initial
Catalog=Contacts;Trusted_Connection=Yes
Here is the connection string from the new ASP.NET application:
workstation id=mywebserver;packet size=4096;integrated security=SSPI;data
source=mydbserver;persist security info=False;initial catalog=Contacts;
I should also point out that I have no trouble connecting from the VS.NET
environment itself, under the Data Connections subtree in the Server
Explorer pane. The ASP.NET connection string above was generated
automatically for me when I added a SqlConnection object in the designer, so
you would think it would work.
From this I would guess that there's some configuration that's wrong, but
I've tried a number of things and numerous MSDN and google searches with no
luck. I'm hoping someone here can help.
Thanks,
Greg
an ASP.NET application.
The strange thing is that I can connect fine using ADODB in an old-fashioned
ASP application, but I get the message "SQL Server does not exist or access
denied" when I try to connect using the SqlConnection object in an ASP.NET
C# application running on the same machine.
The database is SQL Server 2000 running on Windows Server 2003, and the
development machine is running Windows XP with VS.NET 2003, .NET Framework
1.1.
The database server is named "mydbserver", and the developer machine is
named "mywebserver".
Here is the connection string from the old ASP application:
Provider=SQLOLEDB;Server=mydbserver;Initial
Catalog=Contacts;Trusted_Connection=Yes
Here is the connection string from the new ASP.NET application:
workstation id=mywebserver;packet size=4096;integrated security=SSPI;data
source=mydbserver;persist security info=False;initial catalog=Contacts;
I should also point out that I have no trouble connecting from the VS.NET
environment itself, under the Data Connections subtree in the Server
Explorer pane. The ASP.NET connection string above was generated
automatically for me when I added a SqlConnection object in the designer, so
you would think it would work.
From this I would guess that there's some configuration that's wrong, but
I've tried a number of things and numerous MSDN and google searches with no
luck. I'm hoping someone here can help.
Thanks,
Greg