473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Help connnecting to sql server

hi every1 :lol: ,

i am new to .net and c# but i am making a good progress. i am working
on database connectivity but i cant connect to my sql
server(northwind). Pls tell me what am doing wrong :( .

I have tried 3 connectionStrings
"DATA SOURCE=(local); Initial Catalog=PUBS; Integrated
Security=SSPI";
"DATA SOURCE=(local); Initial Catalog=PUBS; UID=sa;Pwd=password";
"DATA SOURCE=(local); Initial Catalog=PUBS; User ID=sa;
Password=password";

but i keep getting this err mgs :

An unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred in system.data.dll

Additional information: System error.

pls tell me what to do, i believe connecting to sql server dbs will
boost my c# implementation.

thanks in advance.

King

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #1
2 3226
Raj
If you are using SQL 6.5 or earlier specify the Provider in the Connection
String and in case if you are using SQL 7.0 or above, specify the string

"DATA SOURCE=localhost; Initial Catalog=PUBS; Integrated Security=SSPI";

DataSource should be localhost or your SQL Server Computer name
Raj

"Kingkel" wrote:
hi every1 :lol: ,

i am new to .net and c# but i am making a good progress. i am working
on database connectivity but i cant connect to my sql
server(northwind). Pls tell me what am doing wrong :( .

I have tried 3 connectionStrings
"DATA SOURCE=(local); Initial Catalog=PUBS; Integrated
Security=SSPI";
"DATA SOURCE=(local); Initial Catalog=PUBS; UID=sa;Pwd=password";
"DATA SOURCE=(local); Initial Catalog=PUBS; User ID=sa;
Password=password";

but i keep getting this err mgs :

An unhandled exception of type 'System.Data.SqlClient.SqlException'
occurred in system.data.dll

Additional information: System error.

pls tell me what to do, i believe connecting to sql server dbs will
boost my c# implementation.

thanks in advance.

King

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 16 '05 #2
Hmm, I frequently use (local) to connect to SQL Server 2000 and MSDE.

Without seeing ther actual exception trace (the fact that its a SQLException only tells us a small amount). You state that you wanted to connect to the northwind database (either that or you said the name of your server was northwind - I'll assume the former).Yet in the connection strong you specify the PUBS database as the database you want to connect to. Does the pubs database exist on the server?

Regards

Richard Blewett - DevelopMentor
http://staff.develop.com/richardb/weblog

If you are using SQL 6.5 or earlier specify the Provider in the Connection
String and in case if you are using SQL 7.0 or above, specify the string

"DATA SOURCE=localhost; Initial Catalog=PUBS; Integrated Security=SSPI";

DataSource should be localhost or your SQL Server Computer name
Raj

"Kingkel" wrote:
hi every1 :lol: ,

i am new to .net and c# but i am making a good progress. i am working
on database connectivity but i cant connect to my sql
server(northwind). Pls tell me what am doing wrong :( .

I have tried 3 connectionStrings
"DATA SOURCE=(local); Initial Catalog=PUBS; Integrated
Security=SSPI";


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: cooldv | last post by:
i am running a website on Windows 2000 server with ASP 3 webpages and Access 2000 database. (with a hosting company) traffic is slow at this time but expect to grow. lately i have been reading...
1
by: Joe Seamour | last post by:
I would like to access a table in MS Access from a stored procedure on MS SQL 2000. The MS Access DB is running on a diferent computer attached on the same network. I think I need to create an ODBC...
5
by: Craig Keightley | last post by:
Please help, i have attached my page which worksin IE but i cannnot get the drop down menu to fucntion in firefox. Any one have any ideas why? Many Thanks Craig ...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
10
by: Joe | last post by:
Hi, Tried using the FindControl() but no luck in finidng this damn textbox having id txtFirstName. Can someone help me with this method? This is what I have been doing but it doesn't work, ...
15
by: DavidS | last post by:
Have Visual Studio.NET installed on MS 2000 Professional OS laptop. No issue ever with web development and SQL connections. Purchased new laptop with XP Professional SP2!!!!!!!! & Visual...
16
by: pamelafluente | last post by:
I am still working with no success on that client/server problem. I need your help. I will submit simplified versions of my problem so we can see clearly what is going on. My model: A client...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
3
by: Shane Story | last post by:
I need to have an app run on several machines in a LAN. They all need to know of each other's existence and be able to communicate simple messages back and forth. These messages should be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.