Solved

SQL Server 2000  connecting to .net 1.1

Posted on 2007-12-03
3
210 Views
Last Modified: 2013-11-26
Hi,
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);
connection.Open();

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.
thanks
0
Comment
Question by:tag_k
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
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);
connection.Open();

Open in new window

0
 
LVL 10

Expert Comment

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

http://support.microsoft.com/kb/328306
0
 
LVL 9

Assisted Solution

by:the_b1ackfox
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  0.0.0.0:1433   0.0.0.0:0   Listening  (if you see this then your server is listening on the default SQL port.
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

705 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