[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SQL Server 2000  connecting to .net 1.1

Posted on 2007-12-03
3
Medium Priority
?
219 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 1000 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 1000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Hello there! As a developer I have modified and refactored the unit tests which was written by fellow developers in the past. On the course, I have gone through various misconceptions and technical challenges when it comes to implementation. I would…
This shares a stored procedure to retrieve permissions for a given user on the current database or across all databases on a server.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

834 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