Re: Sql Server doesnot exist or access denied

Tech-Archive recommends: Speed Up your PC by fixing your registry



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.

Gomathi wrote:
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



.



Relevant Pages

  • Problems linking up SQL Server and ADSI
    ... are running on the local machine. ... I created the link in SQL server using the "OLEDB Provider for Microsoft ... The security is set to "Be made without ... Klaus Salchner ...
    (microsoft.public.sqlserver.connect)
  • link SQL Server with ADSI
    ... are running on the local machine. ... I created the link in SQL server using the "OLEDB Provider for Microsoft ... The security is set to "Be made without ... Klaus Salchner ...
    (microsoft.public.sqlserver.connect)
  • Re: EXECUTE permission denied on object sp_sdidebug, database m
    ... It is just your local machine where you are having problems right? ... you need to install SQL Server before installing VS.Net and the .Net ... >> the aspnet account or your Windows login account to the SQL Server ...
    (microsoft.public.dotnet.framework.aspnet)
  • Conn String With Local DB
    ... im developing a asp.net web app on my local machine using sql server as a back end. ... the user name in my local machine does refer to the pc name HQJ1759DX/ASPNET ... as well as the remote machine, so im assuming this is the case, but i wanted to get some feedback from this forum. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: easy sql connection
    ... On my local machine. ... privilages to access an instance of Northwind. ... > Do you have a named instance of SQL Server or default instance? ... >> Connection failed to open. ...
    (microsoft.public.dotnet.framework.aspnet)