473,396 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Run-time error: SQL Server does not exist or access denied

I attempt to connect ASP.NET application with SQL Server using ADO.NET. I
just open a connection, and it had run-time error in line 34: cn.open():
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 32: Dim connectionString As String = "Data Source=(local);
Initial Catalog=mydatabase"
Line 33: Dim cn As New SqlConnection(connectionString)
Line 34: cn.Open()
Line 35: Response.Write(cn.ConnectionString & "," &
txtBoxUserName.Text)
Line 36: 'Debug.WriteLine(cn.ConnectionString)
any ideas?? Thanks!
Nov 17 '05 #1
3 2492
Hi Matthew,

You need to provide details of how you are going to be authenticated in the
connection string. Either a sql server username & password or a value like
"Trusted_Connection=yes".

HTH,

--
Greg Low (MVP)
MSDE Manager SQL Tools
www.whitebearconsulting.com

"Matthew Louden" <jr********@hotmail.com> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
I attempt to connect ASP.NET application with SQL Server using ADO.NET. I
just open a connection, and it had run-time error in line 34: cn.open():
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 32: Dim connectionString As String = "Data Source=(local);
Initial Catalog=mydatabase"
Line 33: Dim cn As New SqlConnection(connectionString)
Line 34: cn.Open()
Line 35: Response.Write(cn.ConnectionString & "," &
txtBoxUserName.Text)
Line 36: 'Debug.WriteLine(cn.ConnectionString)
any ideas?? Thanks!

Nov 17 '05 #2
Hi Matthew,

Check if this is not your case

http://support.microsoft.com/default...Product=aspnet

--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp
"Matthew Louden" <jr********@hotmail.com> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
I attempt to connect ASP.NET application with SQL Server using ADO.NET. I
just open a connection, and it had run-time error in line 34: cn.open():
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 32: Dim connectionString As String = "Data Source=(local);
Initial Catalog=mydatabase"
Line 33: Dim cn As New SqlConnection(connectionString)
Line 34: cn.Open()
Line 35: Response.Write(cn.ConnectionString & "," &
txtBoxUserName.Text)
Line 36: 'Debug.WriteLine(cn.ConnectionString)
any ideas?? Thanks!

Nov 17 '05 #3
Two possibilities:

1. SQL Server is not running.
2. The connection string has some problems. You may like to do add
username / password, or opt for a trusted connection.

Cheers,
Gaurav
"Matthew Louden" <jr********@hotmail.com> wrote in message
news:uo**************@TK2MSFTNGP12.phx.gbl...
I attempt to connect ASP.NET application with SQL Server using ADO.NET. I
just open a connection, and it had run-time error in line 34: cn.open():
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 32: Dim connectionString As String = "Data Source=(local);
Initial Catalog=mydatabase"
Line 33: Dim cn As New SqlConnection(connectionString)
Line 34: cn.Open()
Line 35: Response.Write(cn.ConnectionString & "," &
txtBoxUserName.Text)
Line 36: 'Debug.WriteLine(cn.ConnectionString)
any ideas?? Thanks!

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: leroybt.rm | last post by:
Can someone tell me how to run a script from a interactive shell I type the following: >>>python filename >>>python filename.py >>>run filename >>>run filename.py >>>/run filename >>>/run...
4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
2
by: Jenna Olson | last post by:
Hi all- I've never seen this particular issue addressed, but was wondering if there's anything to support one way or another. Say I have a class: class ManipulateData { public:...
7
by: erniedude | last post by:
Hi, I'm a newbie and I was wondering if anyone knew a (Python) script to run 4 batch files, one after the other (assuming the directories are known). It would be better if all 4 batch files...
19
by: n0sPaM | last post by:
Is it possible to schedule an .ASPX page to run automatically, say every hour? N.B.
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
2
by: Dan | last post by:
Hello, I am just now converting from the world of DOS. Making simple VB.NET apps was easier than I expected. Now I need some control over the window that the app is running in. Can a VB.NET...
6
by: Joel | last post by:
2 Questions: (1) The documentation says application.run() creates a standard message loop on the current thread and "optionally" shows a form. This is really confusing because I was of the...
7
by: Lee Crabtree | last post by:
I remember when I was first getting into .NET Forms programming that there was a rather emphatic rule about not constructing a form before calling Application.Run with it. So this: ...
26
by: Chief | last post by:
Hello i would like to know which syntax do i have to use in order to make a program run other *.exe program and also how to put inputs in it for example i want to to make a program that run...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.