Newbie Question about database access.

G

Gordon

Why do I get this message when I try to connect to a SQL
database running on a local machine. The server is up and
running. I am using MSDE on this computer and attempting
to access the practice database, Northwind. The only
thing that I have tried is to grant permission to access
the database to the user
ASPNET via the osql utility.

Any suggestions would be greatly appreciated.

Thanks,

Gordon

Here is the message :

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 53: // SqlConnection
("server=
(local);database=Customers;Trusted_Connection=yes");
Line 54: SqlConnection("Persist
Security Info=False;Integrated
Security=SSPI;database=northwind;server=(local);Connect
Timeout=30;Trusted_Connection=Yes");
Line 55: cnCustomers.Open();
Line 56: SqlDataAdapter
daCustomers = new
Line 57: SqlDataAdapter
("Select * from Customers", cnCustomers);


Source File: h:\inetpub\wwwroot\webapp1112
\webapp1114.aspx.cs Line: 55

Stack Trace:


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

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledCo
nnection(SqlConnectionString options, Boolean&
isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
WebApp1112.WebApp1114.Button1_Click(Object sender,
EventArgs e) in h:\inetpub\wwwroot\webapp1112
\webapp1114.aspx.cs:55
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEv
entHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
 
C

-=Chris=-

Depending on the install of MSDE, it may not register under the default
local instance. You may have to specify the server using the format:

MACHINE_NAME\INSTANCE_NAME

For example, in the past, mine's always been MACHINE_NAME\VsDotNet, because
I use the MSDE setup distributed with VS.NET, which defaults the instance
name to VsDotNet.

I was minding my own business when Gordon blurted out:
Why do I get this message when I try to connect to a SQL
database running on a local machine. The server is up and
running. I am using MSDE on this computer and attempting
to access the practice database, Northwind. The only
thing that I have tried is to grant permission to access
the database to the user
ASPNET via the osql utility.

Any suggestions would be greatly appreciated.

Thanks,

Gordon

Here is the message :

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 53: // SqlConnection
("server=
(local);database=Customers;Trusted_Connection=yes");
Line 54: SqlConnection("Persist
Security Info=False;Integrated
Security=SSPI;database=northwind;server=(local);Connect
Timeout=30;Trusted_Connection=Yes");
Line 55: cnCustomers.Open();
Line 56: SqlDataAdapter
daCustomers = new
Line 57: SqlDataAdapter
("Select * from Customers", cnCustomers);


Source File: h:\inetpub\wwwroot\webapp1112
\webapp1114.aspx.cs Line: 55

Stack Trace:


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

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledCo
nnection(SqlConnectionString options, Boolean&
isInTransaction)
System.Data.SqlClient.SqlConnection.Open()
WebApp1112.WebApp1114.Button1_Click(Object sender,
EventArgs e) in h:\inetpub\wwwroot\webapp1112
\webapp1114.aspx.cs:55
System.Web.UI.WebControls.Button.OnClick(EventArgs e)

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEv
entHandler.RaisePostBackEvent(String eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(IPostBackEventHandler sourceControl, String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent
(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
 

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

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top