473,386 Members | 1,763 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.

C# connects to SQL Server Database

Hi I'm newbie in C# database programming and SQL Server as well.

I am using windows XP on my laptop. MSSQLServer Client is installed. The connection is set to use Windows authentication. My windows user name is "stephanie cat" without any password.

I use C# in VS.NET 2003 to connect to SQL Server database (a simple console application). The northwind database has been downloaded and attached to current SQL Server instance. I can view the northwind database ok in Enterprise Manager.

The connection string is:
Expand|Select|Wrap|Line Numbers
  1. SqlConnection mySqlConnection = new SqlConnection("server=localhost;database=Northwind;uid=sa;pwd=sa");
  2.  
It didn't work.
So I set up a user "sa" with a pwd in "local user and groups" of "computer management". It didn't work.

Then I think since the SQL server is using windows authentication, I delete "uid=sa;pwd=sa" in the connection string. It didn't work.

I changed "uid= Stephanie cat; pwd=". It didn't work.

Then i try to change SQL server connection into SQL server authentication. It failed with a message:"Login failed for user 'sa'. Reason: not associated with a trusted SQL Server connection." but how do I associated a user with a trusted SQL Server connection. does the user have to be a windows user name. But in XP, there is no DBA group. I am confused about this sa uid.

could anybody help me with it please?
Apr 19 '07 #1
0 1530

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rhek | last post by:
Hello, I am hoping that someone can provide a code sample using the following sample information below. I am wanting to create a vb.net application that is run on a local computer and connects...
0
by: Visu | last post by:
DB2 7.2 EEE AIX 5.2 Instance is partitioned over two servers. Server A - Catalog node & 4 data node Server B - 4 data node Local and remote connection times to the only database on this...
2
by: Voyager | last post by:
Hi, Where can I find a sample vb.net application that connects to an MS Access database and does sql statement calls to retrieve, update etc...? I do not have the vb resource kit and cannot...
0
by: Johannes Barop | last post by:
Hello, I search a way to realize following: When a user connects to a databse, a function of my should be executed. The best would be a system table where the active Databaser Users are in, and...
12
by: mistral | last post by:
phpMyAdmin 2.6.2 problem: can no connects to mySQL database: each time shown error #1045 - Access denied for user 'username'@'192.168.1.2' (using password: YES) Is seems, this is most common...
1
by: LamSoft | last post by:
Is there any method to let aspx connects to WMI to get system information. I found that there is a method called "System.Management.ManagementObjectSearcher, but when I tried to import it, the...
1
by: amgupta8 | last post by:
Note: This problem occurred when I updated the JDK from 1.3.1 to 1.4.1 or 1.4.2. Nothing else was changed in the code, other than updating the JDK on the database server (dbm cfg parm jdk_path) and...
2
by: bmamo | last post by:
HI, i have a problem similar to this one, but mainly the problem is that my php connects to the mails server, but disconnects immediately. for example: here is the log of the mail server: ...
6
by: DevX | last post by:
Hello, I have a big intranet that I run with IIS 6.0. I need to log the client's machine names, and I found on the web istruction on how to use REMOTE_HOST server variable while enabling...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.