Ask a Question related to ASP.NET General, Design and Development.
-
Bassel Tabbara [MSFT] #1
RE: SQL Server does not exist or access denied
Problem:
=======
Coonection String:
<add key="TaxonomyConnection" value="User
ID=WebUser;Password='pass';Initial Catalog=Taxonomy;Data
Source=spectre;Network Library =dbmssocn" />
If that is true, then why is the web.config included in
the deployment? When he changed the string (added the
Network Library attribute to force TCP/IP) then does that
mean the application was still using the string as
compiled and not picking up the change?
That connection string is then declared as a global
string variable in the global.asax codebehind as
Public Const CfgTaxonomyConnection As String
= "TaxonomyConnection"
In the WebForm codebehind pages he is using the Data
Access Application Blocks which look something like this
Dim dsData As DataSet =
DataAccessLayer.SqlHelper.ExecuteDataset
(ConfigurationSettings.AppSettings
(Global.CfgTaxonomyConnection), "usp_GetKingdoms")
Remember, this code works well from my development
workstation but fails when deployed to the intermediate
machine.
Solution:
=======
Building Secure ASP.NET Applications: Authentication, Authorization, and
Secure Communication
ASP.NET Security
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/ht[/url]
ml/SecNetch08.asp
Here's the section of this article that you may find it useful:
"When the application is not configured for impersonation, the ASP.NET
process identity provides
the default identity when your application attempts to access remote
resources. If you want to use the
ASP.NET process account for remote resource access, you have three options:
Use mirrored accounts.
This is the simplest approach. You create a local account with a matching
user name and password on
the remote computer. You must change the ASPNET account password in User
Manager to a known
value (always use a strong password). You must then explicitly set this on
the <processModel> element
in Machine.config, and replace the existing "AutoGenerate" value.
Bassel Tabbara [MSFT] Guest
-
SQL Server does not exist or access denied.
Hi, I had the same issues. I ended up learning more about SQL that I had intended. In the end I discovered that GrocerToGo had not been installed... -
Access Denied. The file may not exist,...
Hello everyone, I have no idea why this issue keeps poping up... what have i done wrong... any ideas here is the error message... Access... -
"Server does not exist or access is denied"
Hi, I am trying to connect a web service to an SQL Server 2000 database. SQL Server is installed and started and the database appears on the... -
Error: SQL Server does not exist or access denied
My client has a server running Windows 2003 Server and SQL Server 2000. The sole purpose of the server is to run a single web site. It was... -
SQL Server does not exist or access denied. - nothings changed
Everything has worked fine for about a month, then all of a sudden I get this error message: Sql server access denied or does not exist. I... -
Ravikanth[MVP] #2
SQL Server does not exist or access denied
Hi
Are you using named instances of SQL Server?
First check whether u r able to connect to SQL Server to
SQL Enterpraise manager
HTH
Ravikanth
a>-----Original Message-----
>I am running an asp.net application on my development
>machine (Win2K, .NET framework). This prog connects tofollowing>SQL Server (on another machine).
>When I run the following code it errors with thecd>message: "SQL Server does not exist or access denied"
>
>Dim strConnect As String = Application("CONN")
>Dim cnIntranet As New SqlConnection(strConnect)
>Try
> cnIntranet.Open()
>Catch ex As SqlException
> Response.Write(ex.Message & "<BR>")
> Return
>End Try
>
>'Where
>'Application("CONN")
>= "server=servername;database=dbname;uid=loginname;p wd=abaccess>efg"
>
>However if I copy the project up to the production
>Intranet server (Win2k) it works fine (pointing at the
>same sql server as when it doesn't work).
>I haven't done anything on the SQL server to allow>from the production Intranet server but it works from
>there, but not my local IIS.
>
>I know this is probably a basic security problem but
>having searched the internet I can't find a soln.
>
>Regards
>.
>Ravikanth[MVP] Guest
-
Natty Gur #3
Re: SQL Server does not exist or access denied
Hi,
Check if the SQL server set to work with windows authentication. If so,
check if your client web application set to use anonymous user while the
server application isn’t.
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Fiona Wallace #4
SQL Server does not exist or access denied
Thanks for reply. I am able to connect to this sql server
by many others means (query analyzer, enterprise mgr and
also the same .net app when running from production
server). It's only when I run it from LOCAL iis it doesn't
work.
If by "named instance" you mean using the actual name as
opposed to IP address? then yes, I'm using the actual name
of the server.
>-----Original Message-----
>Hi
>
>Are you using named instances of SQL Server?
>First check whether u r able to connect to SQL Server to
>SQL Enterpraise manager
>
>
>HTH
>Ravikanth
>
>Fiona Wallace Guest
-
Fiona Wallace #5
Re: SQL Server does not exist or access denied
Thanks for reply. SQL is set to use mixed authentication
(sql server and windows authentication). My local client
web app was indeed set up to use anonymous (and the
production server wasn't). I set the local to match the
production, but still no luck. I'm getting the same error
(I also restarted too for good measure).
I've had a look at all the other settings and can't see
any differences.
Fiona Wallace Guest
-
Natty Gur #6
Re: SQL Server does not exist or access denied
Try to add Impersonate=true in your web.config
Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114
Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377
Know the overall picture
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Fiona Wallace #7
Re: SQL Server does not exist or access denied
Thankyou very much!
Adding <identity impersonate="true"/> has made it work.
Is there a way I can set this as a default? Or will I have to add this
line to the project's web.config for every project I develop locally?
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Fiona Wallace Guest
-
Fiona Wallace #8
Re: SQL Server does not exist or access denied
managed to answer my own question: add impersonate="true" in
machine.config rather than individual web.config files.
Thanks for everyone's help.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Fiona Wallace Guest



Reply With Quote

