none
how to connect using a specific sql server 2005 user RRS feed

  • Question

  • i have used this article :

    http://aspnet.4guysfromrolla.com/articles/110905-1.aspx

    and i got this :

     

    <connectionStrings>

    <add name="localCon" connectionString="Data Source=localhost;Integrated Security=True"

    providerName="System.Data.SqlClient" />

    </connectionStrings>

     

    and i want to define on this connection which sql server user to use (beacuse i gave it certin permission ) how do i do it?

    thanks i nadvance

    peleg

    Saturday, July 7, 2007 9:15 PM

All replies

  • if I understand correctly, you wish to modify the connection string so it can login using SQL Authentication rather than Windows Authentication.

    If this is the case then simply modify the connectionstring as follows:

     

    data source=Server;Trusted_Connection=false;Initial Catalog=DatabaseName;User ID=username;Password=password

     

    this will now authenticate/try to login using the specified username/password given in the connectionstring.

     

    Does this help? Is this what you are after?

    Sunday, July 8, 2007 2:25 PM
  • yes thanks alot!
    Tuesday, July 10, 2007 9:34 PM