欢迎来到天天文库
浏览记录
ID:30429301
大小:99.93 KB
页数:33页
时间:2018-12-29
《数据库连接字符串大全》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、数据库连接字符串大全转自:SQLServerODBCStandardSecurity:"Driver={SQLServer};Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;"Trustedconnection:"Driver={SQLServer};Server=Aron1;Database=pubs;Trusted_Connection=yes;"PRomptforusernameandpassWord:oConn.Properties("Prompt")=
2、adPromptAlwaysoConn.Open"Driver={SQLServer};Server=Aron1;DataBase=pubs;"OLEDB,OleDbConnection(.NET)StandardSecurity:"Provider=sqloledb;DataSource=Aron1;InitialCatalog=pubs;UserId=sa;Password=asdasd;"TrustedConnection:"Provider=sqloledb;DataSource=Aron1;I
3、nitialCatalog=pubs;IntegratedSecurity=SSPI;"(useserverNameinstanceNameasDataSourcetouseanspecifikSQLServerinstance,onlySQLServer2000)Promptforusernameandpassword:oConn.Provider="sqloledb"oConn.Properties("Prompt")=adPromptAlwaysoConn.Open"DataSource=Aro
4、n1;InitialCatalog=pubs;"Connectviaanipaddress:"Provider=sqloledb;DataSource=190.190.200.100,1433;NetworkLibrary=DBMSSOCN;InitialCatalog=pubs;UserID=sa;Password=asdasd;"(DBMSSOCN=TCP/IPinsteadofNamedPipes,attheendoftheDataSourceistheporttouse(1433isthedef
5、ault))SqlConnection(.NET)StandardSecurity:"DataSource=Aron1;InitialCatalog=pubs;UserId=sa;Password=asdasd;"-or-"Server=Aron1;Database=pubs;UserID=sa;Password=asdasd;Trusted_Connection=False"(bothconnectionstringsproducesthesameresult)TrustedConnection:"D
6、ataSource=Aron1;InitialCatalog=pubs;IntegratedSecurity=SSPI;"-or-"Server=Aron1;Database=pubs;Trusted_Connection=True;"(bothconnectionstringsproducesthesameresult)(useserverNameinstanceNameasDataSourcetouseanspecifikSQLServerinstance,onlySQLServer2000)Co
7、nnectviaanIPaddress:"DataSource=190.190.200.100,1433;NetworkLibrary=DBMSSOCN;InitialCatalog=pubs;UserID=sa;Password=asdasd;"(DBMSSOCN=TCP/IPinsteadofNamedPipes,attheendoftheDataSourceistheporttouse(1433isthedefault))DeclaretheSqlConnection:C#:usingSystem
8、.Data.SqlClient;SqlConnectionoSQLConn=newSqlConnection();oSQLConn.ConnectionString="myconnectionstring";oSQLConn.Open();VB.NET:ImportsSystem.Data.SqlClientDimoSQLConnAsSqlConnection=NewSqlConnection()oSQLConn.ConnectionStr
此文档下载收益归作者所有