Sql Server doesnot exist or access denied

G

Gomathi

I am getting a 'SQL Server does not exist or access denied. ' error when
trying to access a SQL Server Database from my local machine. I have the
code on the web server and it is working fine.

My connection string is fine and I am able to log into SQL Server via
Enterprise manager ok.

The code falls over at this line - cmd.Connection.Open()

I have just re-installed .net 1.1 and installed IIS on my local machine. Are
there settings which I need to update possibly?

Thanks for your help.

Regards,
Gomathi
 
A

Andy Fish

are you using windows authentication? - this won't work across then network
because the user who runs the asp.net pages does not have privileges to
access network resources
 
G

Guest

First, try to login in SQL Server through Query Analyzer using the same user
id and password which you have set in connection string.

Second, it is local system set your data source in connection string to the
computer name in case if you have set it as local.

Third, check the password string it is case sensitive.

Regards
Raj
 
S

Sericinus hunter

On your web server try this:

WindowsIdentity wi = (WindowsIdentity)User.Identity;
wi.Impersonate();
// ...do your database access here
wi.Undo();

This assumes that you use Windows identity.
 

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