ASP.NET database won't connect...

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???
 
K

Ken Cox [Microsoft MVP]

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???
 
D

Daniel Bass

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.
 
D

Daniel Bass

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
 
B

Benny Tordrup

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
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top