LINQ to SQL ..Can we have non-integrated windows connection in a connection string

Answered LINQ to SQL ..Can we have non-integrated windows connection in a connection string

  • Friday, November 16, 2012 7:22 PM
     
     

    Meaning

    can't I use a userid and password in the connection string in the app.config file?

    connectionString="Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;”

    When I use like this, it is say's login failed for user <user id>.

    Any help please?

All Replies

  • Friday, November 16, 2012 8:33 PM
     
     

    Hi bnathdotnetarchitect;

    The User ID and Password that you are using in the connection string is the User ID and Password assigned to the user in the database and is not the Windows ID and password, correct.

    If the above did you check the spelling of the two fields to make sure it is correct.  

      


    Fernando (MCSD)

    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

  • Friday, November 16, 2012 10:07 PM
     
     
    yes Sir. the userid is on SQL server. Basically integrated windows authentication is false. We are using the security of SQl server. Does LINQ to SQl allow only integrated windows authentication?
  • Saturday, November 17, 2012 1:38 PM
     
     Answered Has Code

    Using SQL Authentication is a general purpose for connecting  to database and I have  a numerous databases working on LINQ with SQL server authentication

    here is  how connection string must look like

    <add name="DBConnectionString" connectionString="Data Source=SERVERADDRESS;Initial Catalog=DBNAME;Persist Security Info=True;User ID=user;Password=pass" providerName="System.Data.SqlClient" />

    make sure that it is so and all 4 parameters:

    1. Source (SQL Server Name)
    2. Catalog (Database Name)
    3. User ID (Database Username)
    4. Password

    Are correct and  you'll 100% get access  to your database with LINQ


    Please mark as reply if helped.
    Also visit my blog http://msguy.net/

  • Monday, November 19, 2012 5:27 PM
     
     
    Thanks a million Michael
  • Monday, November 19, 2012 9:12 PM
     
     
    You're always welcome

    Please mark as reply if helped.
    Also visit my blog http://msguy.net/