473,405 Members | 2,176 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,405 software developers and data experts.

C# connection string using Windows NT 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 19 '05 #1
2 4602
Maziar since u are using windows Auth udon't need to hard code ur
username and password..
Ur connectionString should look like this:-

string Conn1 = "Data Source=(local);Initial Catalog=Northwind;Integrated
Security=SSPI;"

Hope this helps
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #2
I'd like to add a bit to the previous poster's response.

Unless I misunderstand your issue, you indicate that you are using Windows
authentication to connect to SQL Server 2000 and the connection is working
fine on your computer but not on a remote server. What you do not indicate
is:
1.) If you are connecting to a local instance of SQL Server on your
computer.
2.) If the SQL Server instance that you are connecting to on your computer
is the same as the one you'll be connecting to from the remote server.
3.) How the site is configured on your computer.

From what you have described, it sounds much less like a connection string
coding problem than a configuration issue. The account that the ASP.NET
worker process runs under must have access to the database for integrated
security to work unless impersonation is used in which case the
impersonation account must have access to the database. In the event that
you are unable to have access granted for a particular Windows account,
you'll need to resort to SQL Authentication.

HTH
----------------
Dave Fancher
http://davefancher.blogspot.com

"Maziar Aflatoun" <ma***@rogers.com> wrote in message
news:Gq********************@rogers.com...
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 19 '05 #3

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...
10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
1
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...
9
by: Not Me | last post by:
Hi, I'm using asp.net 2 with an sql server 2000 database. What steps if any, must I take to ensure connection pooling efficiently? for any 'manual' connections made, I open the sqlconnection...
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,...
7
by: galico | last post by:
Hi All, We are having a very strange problem with the above. We have designed an application in ASP.NET 2.0 that uses the enterprise library data application blocks amongst others. We seem to be...
1
by: Sehboo | last post by:
I posted this in another newsgroup but haven't received the answer, so I am trying my luck here as well. My database is running on a seperate machine and my connection string is "user...
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...
4
by: eruth | last post by:
There are loads of post on this, but nothing that seems to cover my exact problem ;) I have an ASP.Net 1.1 web application running on my local machine. I want to connect to an SQL 2005 server...
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?
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.