473,388 Members | 1,382 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,388 software developers and data experts.

C# SQL connection string (Windows authentication)???

Hi guys,

I'm using Windows authentication to connect to SQL Server 2000. On my
computer the connection is fine. Now if I move it to a remote server, how
to I hard code my Username/Password in my connection string (using Windows
NT authentication and not SQL Server authentication)?

Thank you
Maz.
Nov 17 '05 #1
1 84504
You don't.

The main benefit of using Windows authentication for your connection to
SQL Server is that you can avoid coding a username and password into the
connection string.

To indicate you want to use Windows authentication in your connection
string, replace the "user id=xx;password=xx" part with
"Integrated Security=SSPI;"

The connection will be made using whatever account the process is
running under.
If it is an interactive desktop application (WinForms or Console), it
will run under the user's account.
If it is an ASP.NET website, without impersonation enabled, the
connection will be made from the ASPNET (on 2K) or NETWORK SERVICE (on
2K3). With impersonation enabled, and Anonymous access disabled in IIS,
it will run under the client user's account. If Anonymous access is
enabled, it will run under the IUSR_machinename account.

If you do not want to grant all users access to the SQL Server, you can
run your assembly under a specific identity in COM+.
Joshua Flanagan
http://flimflan.com/blog
Maziar Aflatoun wrote:
Hi guys,

I'm using Windows authentication to connect to SQL Server 2000. On my
computer the connection is fine. Now if I move it to a remote server, how
to I hard code my Username/Password in my connection string (using Windows
NT authentication and not SQL Server authentication)?

Thank you
Maz.

Nov 17 '05 #2

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

Similar topics

5
by: Mike | last post by:
I'm trying to connect to a SQL db, I have the db setup as a DSN on my machine, here is my connection string that i'm trying to use. string dbConn = "Provider=sqloeldb;data source=Tech;Initial...
2
by: Raghu Raman | last post by:
Hi, * I used sql server7.0 with sqlserver authentcation.Now we are migrated to sqlserver2000. We are using windows2000. we go into the sqlserver2000 by windows authentication. I tried to...
2
by: Maziar Aflatoun | last post by:
Hi guys, I'm using Windows authentication to connect to SQL Server 2000. On my computer the connection is fine. Now if I move it to a remote server, how to I hard code my Username/Password in...
3
by: Sparky Arbuckle | last post by:
I want to have a connection string stored in my app.config file because I only connect to one database and doesn't make sense to drag and drop a bunch of OleDbDataAdapters (VS .NET) onto the...
14
by: WebMatrix | last post by:
Hello, I have developed a web application that connects to 2 different database servers. The connection strings with db username + password are stored in web.config file. After a code review,...
1
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while...
7
by: =?Utf-8?B?TWFjaHVnYQ==?= | last post by:
My web.config contains: <authorization> <deny users="?" /> </authorization> <authentication mode="Windows" /> <identity impersonate="true" userName="" password="" /> My connection string...
0
by: =?Utf-8?B?WmFkZXA=?= | last post by:
Hello I am trying to send HttWebRequests through a proxy server and I get the error 407, proxy server requires authentication, which is apparently a problem known in Microsoft database #928563....
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.