Connection string using Windows Authentication

后端 未结 4 1254
滥情空心
滥情空心 2020-11-30 20:25

I am creating a website, but in the database I use windows authentication.

I know that you use this for SQL authentication

          


        
4条回答
  •  独厮守ぢ
    2020-11-30 20:54

    For connecting to a sql server database via Windows authentication basically needs which server you want to connect , what is your database name , Integrated Security info and provider name.

    Basically this works:

          
    
     
    

    Setting Integrated Security field true means basically you want to reach database via Windows authentication, if you set this field false Windows authentication will not work.

    It is also working different according which provider you are using.

    • SqlClient both Integrated Security=true; or IntegratedSecurity=SSPI; is working.

    • OleDb it is Integrated Security=SSPI;

    • Odbc it is Trusted_Connection=yes;
    • OracleClient it is Integrated Security=yes;

    Integrated Security=true throws an exception when used with the OleDb provider.

提交回复
热议问题