日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > asp.net >内容正文

asp.net

ADO.NET连接字符串

發(fā)布時間:2025/3/15 asp.net 14 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ADO.NET连接字符串 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
雖然有的字符串不會用到,但了解一下,還是有益的。
名稱
ADO.NET連接字符串
說明ADO.NET連接字符串:SQL Server,SQL Server 2005,ACCESS,Oracle,MySQL,Interbase,IBM DB2,Sybase,Informix,Ingres,Mimer SQL,Lightbase,PostgreSQL,Paradox,DNS,Firebird,Excel ,Text,DBF / FoxPro,AS/400 (iSeries),Exchange,Visual FoxPro,Pervasive,UDL。
?1 - SQL Server
2 - SQL Server 2005
3 - ACCESS, Oracle
4 - MySQL, Interbase, IBM DB2
5 - Sybase, Informix, Ingres, Mimer SQL, Lightbase, PostgreSQL, Paradox, DNS
6 - Firebird, Excel , Text, DBF / FoxPro, AS/400 (iSeries), Exchange, Visual FoxPro, Pervasive, UDL
1
SQL Server
ODBC
標準安全" Driver={SQL Server}; Server=Aron1; Database=pubs; Uid=sa; Pwd=asdasd; "
信任的連接" Driver={SQL Server}; Server=Aron1; Database=pubs; Trusted_Connection=yes; "
提示輸入用戶名和密碼oConn.Properties(" Prompt" ) = adPromptAlways
oConn.Open " Driver={SQL Server}; Server=Aron1; DataBase=pubs; "
OLE DB, OleDbConnection (.NET)
標準安全" Provider=sqloledb; Data Source=Aron1; Initial Catalog=pubs; User Id=sa; Password=asdasd; "
信任的連接" Provider=sqloledb; Data Source=Aron1; Initial Catalog=pubs; Integrated Security=SSPI; "
(use serverName\instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
提示輸入用戶名和密碼oConn.Provider = " sqloledb"
oConn.Properties(" Prompt" ) = adPromptAlways
oConn.Open " Data Source=Aron1; Initial Catalog=pubs; "
IP地址連接管道" Provider=sqloledb; Data Source=190.190.200.100,1433; Network Library=DBMSSOCN; Initial Catalog=pubs; User ID=sa; Password=asdasd; "
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
SqlConnection (.NET)
標準安全" Data Source=Aron1; Initial Catalog=pubs; User Id=sa; Password=asdasd; "
- or -
" Server=Aron1; Database=pubs; User ID=sa; Password=asdasd; Trusted_Connection=False"
(both connection strings produces the same result)
信任的連接" Data Source=Aron1; Initial Catalog=pubs; Integrated Security=SSPI; "
- or -
" Server=Aron1; Database=pubs; Trusted_Connection=True; "
(both connection strings produces the same result)
(use serverName\instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
IP地址連接管道" Data Source=190.190.200.100,1433; Network Library=DBMSSOCN; Initial Catalog=pubs; User ID=sa; Password=asdasd; "
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
定義SqlConnection對象C#:
using System.Data.SqlClient;
SqlConnection oSQLConn = new SqlConnection();
oSQLConn.ConnectionString=" my connection string" ;
oSQLConn.Open();
VB.NET:
Imports System.Data.SqlClient
Dim oSQLConn As SqlConnection = New SqlConnection()
oSQLConn.ConnectionString=" my connection string"
oSQLConn.Open()
Data Shape
MS Data Shape" Provider=MSDataShape; Data Provider=SQLOLEDB; Data Source=Aron1; Initial Catalog=pubs; User ID=sa; Password=asdasd; "
2
SQL Server 2005
SQL Native Client ODBC Driver
標準安全" Driver={SQL Native Client}; Server=Aron1; Database=pubs; UID=sa; PWD=asdasd; "
信任的連接" Driver={SQL Native Client}; Server=Aron1; Database=pubs; Trusted_Connection=yes; "
Equivalents
Integrated Security=SSPI equals Trusted_Connection=yes
提示輸入用戶名和密碼oConn.Properties(" Prompt" ) = adPromptAlways
oConn.Open " Driver={SQL Native Client}; Server=Aron1; DataBase=pubs; "
授權(quán)的MARS(多重活動結(jié)果集)" Driver={SQL Native Client}; Server=Aron1; Database=pubs; Trusted_Connection=yes; MARS_Connection=yes"
Equivalents
MultipleActiveResultSets=true equals MARS_Connection=yes
加密數(shù)據(jù)網(wǎng)絡(luò)傳輸" Driver={SQL Native Client}; Server=Aron1; Database=pubs; Trusted_Connection=yes; Encrypt=yes"
在本地SQL服務(wù)器實例附加數(shù)據(jù)庫文件" Driver={SQL Native Client}; Server=.\SQLExpress; AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
- or -
" Driver={SQL Native Client}; Server=.\SQLExpress; AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
(use |DataDirectory| when your database file resides in the data directory)
SQL Native Client OLE DB Provider
標準安全" Provider=SQLNCLI; Server=Aron1; Database=pubs; UID=sa; PWD=asdasd; "
信任的連接" Provider=SQLNCLI; Server=Aron1; Database=pubs; Trusted_Connection=yes; "
Equivalents
Integrated Security=SSPI equals Trusted_Connection=yes
提示輸入用戶名和密碼oConn.Properties(" Prompt" ) = adPromptAlways
oConn.Open " Provider=SQLNCLI; Server=Aron1; DataBase=pubs; "
授權(quán)的MARS(多重活動結(jié)果集)" Provider=SQLNCLI; Server=Aron1; Database=pubs; Trusted_Connection=yes; MarsConn=yes"
Equivalents
MarsConn=yes equals MultipleActiveResultSets=true equals MARS_Connection=yes
加密數(shù)據(jù)網(wǎng)絡(luò)傳輸" Provider=SQLNCLI; Server=Aron1; Database=pubs; Trusted_Connection=yes; Encrypt=yes"
在本地SQL服務(wù)器實例附加數(shù)據(jù)庫文件" Provider=SQLNCLI; Server=.\SQLExpress; AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
- or -
" Provider=SQLNCLI; Server=.\SQLExpress; AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
(use |DataDirectory| when your database file resides in the data directory)
SqlConnection (.NET)
標準安全" Data Source=Aron1; Initial Catalog=pubs; User Id=sa; Password=asdasd; "
- or -
" Server=Aron1; Database=pubs; User ID=sa; Password=asdasd; Trusted_Connection=False"
(both connection strings produces the same result)
信任的連接" Data Source=Aron1; Initial Catalog=pubs; Integrated Security=SSPI; "
- or -
" Server=Aron1; Database=pubs; Trusted_Connection=True; "
(both connection strings produces the same result)
IP地址連接管道" Data Source=190.190.200.100,1433; Network Library=DBMSSOCN; Initial Catalog=pubs; User ID=sa; Password=asdasd; "
(DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
授權(quán)的MARS(多重活動結(jié)果集)" Server=Aron1; Database=pubs; Trusted_Connection=True; MultipleActiveResultSets=true"
Note! Use ADO.NET 2.0 for MARS functionality. MARS is not supported in ADO.NET 1.0 nor ADO.NET 1.1
在本地SQL服務(wù)器實例附加數(shù)據(jù)庫文件" Server=.\SQLExpress; AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname; Database=dbname; Trusted_Connection=Yes; "
- or -
" Server=.\SQLExpress; AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname; Trusted_Connection=Yes; "
Using " User Instance" on a local SQL Server Express instance" Data Source=.\SQLExpress; integrated security=true; attachdbfilename=|DataDirectory|\mydb.mdf; user instance=true; "
The " User Instance" functionality creates a new SQL Server instance on the fly during connect. This works only on a local SQL Server 2005 instance and only when connecting using windows authentication over local named pipes. The purpose is to be able to create a full rights SQL Server instance to a user with limited administrative rights on the computer. To enable the functionality: sp_configure 'user instances enabled','1' (0 to disable)
Using SQL Server 2005 Express? Don't miss the server name syntax: SERVERNAME\SQLEXPRESS (Substitute " SERVERNAME" with the name of the computer)
Context Connection - connecting to " self" from within your CLR stored prodedure/function
Context Connection - connecting to " self" from within your CLR stored prodedure/function
C#using(SqlConnection connection = new SqlConnection("context connection=true"))
{
connection.Open();
// Use the connection
}
Visual BasicUsing connection as new SqlConnection("context connection=true")
connection.Open()
' Use the connection
End Using
Read more
When to use SQL Native Client?.Net applications
Do not use the SQL Native Client. Use the .NET Framework Data Provider for SQL Server (SqlConnection).
COM applications, all other then .Net applications
COM applications, all other then .Net applications
Use the SQL Native Client if you are accessing an SQL Server 2005 and need the new features of SQL Server 2005 such as MARS, encryption, XML data type etc. Continue use your current provider (OLE DB / ODBC through the MDAC package) if you are not connecting to an SQL Server 2005 (that's quite obvious eh..) or if you are connecting to an SQL Server 2005 but are not using any of the new SQL Server 2005 features.

總結(jié)

以上是生活随笔為你收集整理的ADO.NET连接字符串的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 69国产成人精品二区 | 在线久草 | 女仆裸体打屁屁羞羞免费 | 综合网在线观看 | 国产成人免费看 | 色羞羞 | 色国产精品 | 天天射综合网站 | 日韩在线观看视频一区二区三区 | 91麻豆国产在线观看 | 播放美国生活大片 | 五月丁香 | 青青免费在线视频 | 夫妻性生活黄色片 | 在线网站黄| 天天尻逼 | 国产无遮挡又黄又爽又色视频 | 日韩理论在线观看 | 日本美女交配 | 九九热国产 | 亚洲视频一区二区三区四区 | 91麻豆精品国产 | 国产一区在线免费观看 | 99热这里| 午夜小视频在线播放 | 四虎视频在线观看 | 高清视频在线播放 | 美女精品在线 | 中国一极毛片 | 好男人天堂网 | 国产91国语对白在线 | 久久久久影视 | 激情久久久久久久 | 成人黄色在线视频 | 亚洲成熟女性毛茸茸 | 国产真人无码作爱视频免费 | 天天天天 | 日韩理论视频 | 激情视频网站在线观看 | 美女脱衣服一干二净 | 91爱视频 | 色偷偷噜噜噜亚洲男人 | 国产一区二区三区久久久 | 国产精品乱码一区 | 波多野结衣视频网址 | 亚洲综合视频网站 | 日韩毛片在线 | 加勒比综合在线 | 一区二区在线观看免费视频 | 久久综合鬼色 | 成人91免费视频 | 欧美日韩在线观看一区二区三区 | 国产最新在线观看 | 日本一区视频在线观看 | 久久94| 清纯唯美第一页 | 国产干b| 久久网伊人 | 日韩一级一级 | 国产极品免费 | 亚洲黄色a级片 | 人妻精品一区一区三区蜜桃91 | 色人天堂 | 国产成年无码久久久久毛片 | 国产日韩欧美久久 | 精品欧美久久久 | 综合久久中文字幕 | 超碰中文字幕 | 欧美一区二区三区免费 | 大尺度摸揉捏胸床戏视频 | 揄拍成人国产精品视频 | 人体写真 福利视频 | 久久国产精品网站 | 天天爽av| 在线亚洲免费 | 奇米四色在线观看 | 久久免费小视频 | 天天操天天操天天操天天操天天操 | av每日更新在线观看 | 欧美播放器 | 都市激情 亚洲 | 91黑丝在线观看 | 欧美 变态 另类 人妖 | 亚洲AV乱码国产精品观看麻豆 | 欧美另类一区二区 | 天海翼一区 | 国产精品第六页 | 国产精彩视频一区 | 97在线视频人妻无码 | 强行糟蹋人妻hd中文字幕 | 国产视频在线播放 | 欧美日韩中文国产一区发布 | av大片网站 | 亚洲国产精一区二区三区性色 | 贝利弗山的秘密在线观看 | 永久中文字幕 | 广州毛片 | av青娱乐 | 久久mm|