Solved

SQL Server 2000  connecting to .net 1.1

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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.

747 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

8 Experts available now in Live!

Get 1:1 Help Now