SQL Server 2000  connecting to .net 1.1

Posted on 2007-12-03
Last Modified: 2013-11-26
How to start SQL Server 2000 and use it for .net application.

i have used SQL connection as

SqlConnection connection = new SqlConnection("Data Source=LOCAL;DataBase=ecomm;User ID=sa;Password=comt");
string strSelect = "SELECT productname FROM walts WHERE productid='" + TextBox1.Text + "'";
SqlCommand cmd = new SqlCommand(strSelect, connection);

I have an error at connection.Open()  saying

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.

i am using .net1.1/c#/sql server2000.
Question by:tag_k
  • 2
LVL 10

Accepted Solution

digitalZo earned 250 total points
ID: 20394332
Try it as:
SqlConnection connection = new SqlConnection("uid=sa;pwd=comt;server=localhost;database=ecomm");

string strSelect = "SELECT productname FROM walts WHERE productid='" + TextBox1.Text + "'";

SqlCommand cmd = new SqlCommand(strSelect, connection);


Open in new window

LVL 10

Expert Comment

ID: 20394349
Also, you might want to go through this:

Assisted Solution

the_b1ackfox earned 250 total points
ID: 20394552
Assuming that the password is correct for the SA user...

first thing that pops to my mind, is what does local resolve to?  go to the cmd prompt and ping LOCAL and see if it returns Pings.  If it returns pings, go to the sql server and do a netstat -na from the servers cmd prompt.  look for an entry that looks like this:  TCP   Listening  (if you see this then your server is listening on the default SQL port.

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
T-SQL: Subtracting Amounts from "Among Rows" 3 41
SQL Exceptions 3 36
Automated testing suggestions? 2 22
Help Extract Specific in SQL 8 16
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now