C# connection string using Windows NT Authentication

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maziar Aflatoun

    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.


  • Patrick Olurotimi Ige

    #2
    Re: C# connection string using Windows NT Authentication

    Maziar since u are using windows Auth udon't need to hard code ur
    username and password..
    Ur connectionStrin g should look like this:-

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

    Hope this helps
    Patrick


    *** Sent via Developersdex http://www.developersdex.com ***

    Comment

    • Dave Fancher

      #3
      Re: C# connection string using Windows NT Authentication

      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


      "Maziar Aflatoun" <maz00@rogers.c om> wrote in message
      news:Gq2dnSSITt m9Ze_fRVn-sw@rogers.com.. .[color=blue]
      > 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.
      >
      >[/color]


      Comment

      Working...