ASP.NET database won't connect...

  • Thread starter Thread starter Daniel Bass
  • Start date Start date
D

Daniel Bass

I setup a asp.net project running on http://localhost/ which connects to a
database on another server running sqlserver...

I was able to connect to the database and create my application no problem.

The sqlserver database server had windows 2000 without any SP's or updates.
This was no problem and even though the OS hadn't the .net framework
installed, everything worked fine.

the requirements for that sqlserver database server have since changed, and
windows update was visited to get all the updates, including the latest SP's
as well as the .net framework. I also installed the remote only debugging
for VS.net on this server so that I'm also able to use this as a IIS
server...

Anyway, back to my problem, since these updates the asp.net application i
run from my machine, whcih connects to this database server, has stopped
working with error "SQL Server does not exist or access denied" on the line
where the .Open() is called on the ADO.net database connection object.

Any ideas???
 
It sounds like one of the updates tightened the security on your SQL database.
You'll want to verify that the account you are using for the data still has
sufficient rights.

Is it possible that the sa account or its password was changed?

I setup a asp.net project running on http://localhost/ which connects to a
database on another server running sqlserver...

I was able to connect to the database and create my application no problem.

The sqlserver database server had windows 2000 without any SP's or updates.
This was no problem and even though the OS hadn't the .net framework
installed, everything worked fine.

the requirements for that sqlserver database server have since changed, and
windows update was visited to get all the updates, including the latest SP's
as well as the .net framework. I also installed the remote only debugging
for VS.net on this server so that I'm also able to use this as a IIS
server...

Anyway, back to my problem, since these updates the asp.net application i
run from my machine, whcih connects to this database server, has stopped
working with error "SQL Server does not exist or access denied" on the line
where the .Open() is called on the ADO.net database connection object.

Any ideas???
 
The strange thing is that when i connect to it via the server explorer it
still works, and I'm able to view tables, edit data etc etc...

If i delete my connection, recreate it and rename it, I get the same result.
If I connect to the database via classic ASP, it works fine...

I've checked the sa login but appears it's still okay.
 
Does this mean i have to set up an "asp.net" account?

I've not seen any place to do this, how is it done?

thanks.
Dan
 
Daniel,

Apply the following commands in Query Analyzer (replace <ComputerName> with
the name of the SQL Server Computer and <DatabaseName> with the name of the
database that ASP.NET needs access to:

<SQL>
Exec sp_grantlogin '<ComputerName>\ASPNET'
go

use [<DatabaseName>]
go

EXEC sp_grantdbaccess '<ComputerName>\ASPNET'
go

exec sp_addrolemember @rolename='db_owner', @membername=
'<ComputerName>\ASPNET'
go
</SQL>

Best regards,

Benny Tordrup
 
Back
Top