Solved

SQL Server 2000  connecting to .net 1.1

Posted on 2007-12-03
3
200 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
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.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

813 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

10 Experts available now in Live!

Get 1:1 Help Now