Sql Server doesnot exist or access denied

  • Thread starter Thread starter Gomathi
  • Start date Start date
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
 
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
 
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
 
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.
 
Back
Top