最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

深入sql數(shù)據(jù)連接時的一些問題分析

 更新時間:2013年06月05日 15:26:48   作者:  
本篇文章是對關于sql數(shù)據(jù)連接時的一些問題進行了詳細的分析介紹,需要的朋友參考下
一直還不是很了解connectionstring里各個關鍵詞的區(qū)別,累贅致死
現(xiàn)把一些相關領悟小小述下……
***************************************************
initial catalog與database的區(qū)別是什么
Initial Catalog  ;DataBase:
兩者原來其實沒有任何區(qū)別只是名稱不一樣,就好像是人類的真實姓名與曾用名一樣。。都可以叫你。
********************************************
Integrated Security=SSPI 這個表示以當前WINDOWS系統(tǒng)用戶身去登錄SQL SERVER服務器,如果SQL SERVER服務器不支持這種方式登錄時,就會出錯。
你可以使用SQL SERVER的用戶名和密碼進行登錄,如:
"Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=數(shù)據(jù)庫名;Data Source=192.168.0.1;User ID=sa;Password=密碼"
***************************************************
Integrated   Security     -   或   -    Trusted_Connection   'false'   當為   false   時,將在連接中指定用戶   ID   和密碼。當為   true   時,將使用當前的   Windows   帳戶憑據(jù)進行身份驗證。   可識別的值為   true、false、yes、no   以及與   true   等效的   sspi(強烈推薦)。  
*************************************************
ADO.net   中數(shù)據(jù)庫連接方式
System.Data.SqlClient.SqlConnection
常用的一些連接字符串(C#代碼):
復制代碼 代碼如下:

SqlConnection   conn   =   new   SqlConnection(   “Server=(local);Integrated   Security=SSPI;database=Pubs“);
SqlConnection   conn   =   new   SqlConnection(“server=(local)\NetSDK;database=pubs;Integrated   Security=SSPI“);
SqlConnection   conn   =   new   SqlConnection(“Data   Source=localhost;Integrated   Security=SSPI;Initial   Catalog=Northwind;“);
SqlConnection   conn   =   new   SqlConnection(“   data   source=(local);initial   catalog=xr;integrated   security=SSPI;
persist   security   info=False;workstation   id=XURUI;packet   size=4096;   “);
SqlConnection   myConn     =   new   System.Data.SqlClient.SqlConnection(“Persist   Security   Info=False;Integrated
Security=SSPI;database=northwind;server=mySQLServer“);
SqlConnection   conn   =   new   SqlConnection(   “   uid=sa;pwd=passwords;initial   catalog=pubs;data   source=127.0.0.1;Connect   Timeout=900“);

相關文章

最新評論

远安县| 苍溪县| 和静县| 宜宾县| 遂川县| 仲巴县| 聂拉木县| 金堂县| 南召县| 金门县| 乐陵市| 奉新县| 讷河市| 科技| 宽城| 西充县| 舒兰市| 宣威市| 三都| 合水县| 扶绥县| 淳安县| 广宗县| 平利县| 青海省| 密云县| 樟树市| 东乡族自治县| 方正县| 芜湖市| 中方县| 周至县| 临夏县| 民乐县| 平遥县| 静海县| 水富县| 漠河县| 神池县| 西吉县| 兰考县|