SQL Server does not exist or access denied.

H

hooi

I'm new to Visual Studio.NET and Visual Basic.NET. While trying to run the
sample application, it shows an error message as shown below. I have an SQL
Server containing the sample database Northwind used in this application.
Authentication mode set in Web.config is Windows; Mixed mode in the SQL
Server. Any idea how I can resolve this problem? Thanks...

Server Error in '/HowToBuildAWebDataEntryApp' 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: (Note: highlighted on line 201)

Line 199: Dim scnnNW As New SqlConnection(SQL_CONNECTION_STRING)
Line 200: Dim scmd As New SqlCommand(strSQL, scnnNW)
Line 201: scnnNW.Open()
Line 202: scmd.ExecuteNonQuery()
Line 203: scnnNW.Close()

Source File: C:\Inetpub\wwwroot\HowToBuildAWebDataEntryApp\main.aspx.vb
Line: 201

Stack Trace:

[SqlException: SQL Server does not exist or access denied.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) +472

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
HowToBuildAWebDataEntryApp.Main.SetupDemo() in
C:\Inetpub\wwwroot\HowToBuildAWebDataEntryApp\main.aspx.vb:201
HowToBuildAWebDataEntryApp.Main.Page_Load(Object sender, EventArgs e) in
C:\Inetpub\wwwroot\HowToBuildAWebDataEntryApp\main.aspx.vb:163
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
 
C

Cowboy \(Gregory A. Beamer\)

Check the user name and password. Make sure SQL Server is running in mixed
mode. Also, make sure you have the right server name.

What version of SQL Server? With 6.5, you will want to look at this:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q315159

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Y

Yap Seng Hooi

Thank you Cowboy for your reply

I'm using SQL Server 2000, Visual Studio.NET 2003. The SQL Server is set to mixed mode

When you say 'must have the right Server name', my SQL server name is "NB", do I have to reference it in my main.aspx? My sqlconnection string in the main.aspx is as follows

protected const string SQL_CONNECTION_STRING =
"Server=localhost;" +
"DataBase=northwind;" +
"Integrated Security=SSPI"
 

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