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

  • Question

  • i have used this article :


    and i got this :



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

    providerName="System.Data.SqlClient" />



    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


    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