470,815 Members | 1,227 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

Error: SQL Server does not exist or access denied


I am a new member. Hello to every one. I am new in ASP.NET area. I wrote an ASP.NET web application which was running ok with my old laptop. Currently I have given a new laptop. Now I copied my application to the new laptop and I am experiencing as SQL Server connection error: "SQL Server does not exist or access denied". Following is a simply ASP.NET application to test the connection and I am getting following error:

For your information I am using SQL Server 2000 and Microsoft Visual Studio .NET 2003 and ASP.NET Version:1.1.4322.2032 .
I can connection to the SQL Server using a DataLinks file.
Also I have copied an existing windows C# application from my old laptop where the SQL Server connection working fine.

Thank you for your help in advance.


************************************************** *************************************
Server Error in '/testsqlconn' Application.

SQL Server does not exist or access denied.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error:

Line 23:
Line 24: SqlConnection conn = new SqlConnection("UID=batch;PWD=bbatch;Initial Catalog=TEST;Data Source=NWHEXPRESS");
Line 25: conn.Open();
Line 26: conn.Close();
Line 27:

Source File: c:\inetpub\wwwroot\testsqlconn\testsqlconn.aspx.cs Line: 25

Stack Trace:

[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection (Boolean& isInTransaction)
System.Data.SqlClient.SqlConnectionPoolManager.Get PooledConnection(SqlConnectionString options, Boolean& isInTransaction)
testsqlconn.WebForm1.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\testsqlconn\testsqlconn.aspx.cs :25
System.Web.UI.Control.OnLoad(EventArgs e)

Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

************************************************** *********************
Sep 7 '06 #1
1 3933
[SqlException: SQL Server does not exist or access denied.]

There are a huge number of possibilities as to why you are getting this error.
Make sure your connection string is spelt correctly and if case sensitivity is on make sure the case matches etc.

More likely its a permissions thing. Look at what context the 'user' is attempting to connect to the Database from you ASP appplication you need to know who 'you' are in the context of a server page attampting access, does it have a corresponding user set up in SQL Server, does this user have the correct permissions etc, can you connect with a trusted connection etc., because it's unlikely its connecting as you.

As I say, difficult to diagnose from here, but start with the basics.

Hope this helps

Sep 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Marcos | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.