惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V2EX - 技术
V2EX - 技术
博客园 - Franky
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
MongoDB | Blog
MongoDB | Blog
C
Check Point Blog
P
Proofpoint News Feed
雷峰网
雷峰网
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
I
InfoQ
H
Help Net Security
T
Tailwind CSS Blog
博客园 - 聂微东
博客园 - 【当耐特】
S
Schneier on Security
The Hacker News
The Hacker News
I
Intezer
博客园 - 三生石上(FineUI控件)
量子位
AWS News Blog
AWS News Blog
T
The Exploit Database - CXSecurity.com
腾讯CDC
Hugging Face - Blog
Hugging Face - Blog
P
Palo Alto Networks Blog
P
Privacy International News Feed
V
Vulnerabilities – Threatpost
NISL@THU
NISL@THU
宝玉的分享
宝玉的分享
Cyberwarzone
Cyberwarzone
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Threat Research - Cisco Blogs
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
T
The Blog of Author Tim Ferriss
Security Latest
Security Latest
H
Hacker News: Front Page
Vercel News
Vercel News
A
Arctic Wolf
L
LINUX DO - 热门话题
G
GRAHAM CLULEY
Simon Willison's Weblog
Simon Willison's Weblog
Google Online Security Blog
Google Online Security Blog
W
WeLiveSecurity
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
O
OpenAI News
TaoSecurity Blog
TaoSecurity Blog
Jina AI
Jina AI
爱范儿
爱范儿

博客园 - 网际浪人

.Net Framework 4.0 中利用Task实现并行处理、串并行混合处理 C# Process调用应用程序失败时应注意的问题 程序员的幽默 To腾讯:强行收集用户个人隐私的行为不可饶恕 VS2005打开VS2008项目的2种方法(转) 【转】Oracle Conversion Functions 晨星、银河基金业绩排行榜数据转换工具 ORACLE纯SQL实现多行合并一行 ASP.NET项目添加Log4Net后,发布后无法写日志 “必应”不应、“谷歌”不歌 你好2009,再见2008,牛年犇犇犇 一种在SQLServer中实现Sequence的高效方法 oledb使用Access更新和插入操作的注意点 5.12大地震——小学二年级小表妹谢可欣的诗 GridView自动排序 对HtmlEncode的增强——HtmlEntitiesEncode GridView中使用DataKeyNames存储数据键值 C#调用Excel VBA宏 封装SoapException处理Webservice异常
[转]SQL Server 2005链接字符串
网际浪人 · 2008-05-16 · via 博客园 - 网际浪人

SQL Native Client ODBC Driver

Standard Security

  1. Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword

Trusted Connection

  1. Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes

Connecting to a SQL Server Instance

  1. Driver={SQL Native Client};Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=yes

Prompt UserName and Password

  1. oConn.Properties("Prompt") = adPromptAlways  
  2.   
  3. Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase

Enabling MARS(multiple active results sets)

  1. Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;MARS_Connection=yes

Encrypt data sent over network

  1. Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Encrypt=yes

Attach a database file on connect to a local SQL Server Express Instance

  1. Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes

Attach a database file, located in the data directory, on connect to a local SQL Server Express Instance

  1. Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes

Database Mirroring

  1. Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True;  

SQL Native Client OLE DB Provider

Standard Security

  1. Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword

Trusted Connection

  1. Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes

Connecting to a SQL Server Instance

  1. Provider=SQLNCLI;Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=yes

Prompt for username and password

  1. oConn.Properties("Prompt") = adPromptAlways  
  2.   
  3. oConn.Open "Provider=SQLNCLI;Server=myServerAddress;DataBase=myDataBase

Enabling MARS(multiple active results sets)

  1. Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;MarsConn=yes

Encrypt data sent over network

  1. Provider=SQLNCLI;Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;Encrypt=yes

Attach a database file on connect to a local SQL Server Express Instance

  1. Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes

Attach a database file,located in the data directory,on connect to a local SQL Server Express Instance

  1. Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes

Database Mirroring

  1. Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True;  

SqlConnection (.NET)

Standard Security

  1. Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword

Standard Security alternative syntax

  1. Server=myServerAddress;Database=myDataBase;User ID=myUsername;Password=myPassword;Trusted_Connection=False

Trusted Connection

  1. Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI

Trusted Connection alternative syntax

  1. Server=myServerAddress;Database=myDataBase;Trusted_Connection=True

Connect to a SQL Server Instance

  1. Server=myServerName\theInstanceName;Database=myDataBase;Trusted_Connection=True

Trusted connection from a CE device

  1. Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword

Connect via IP address

  1. Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword

Enabling MARS(multiple active results sets)

  1. Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;MultipleActiveResultSets=true

Attach a database file on connect to a local SQL Server Express Instance

  1. Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes

Attach a database file,located in the data directory,on connect to a local SQL Server Express Instance

  1. Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes

Using an user instance on a local SQL Server Express instance

  1. Data Source=.\SQLExpress;Integrated Security=true;AttachDbFilename=|DataDirectory|\mydb.mdf;User Instance=true

Database Mirroring

  1. Data Source=myServerAddress;Failover Partner=myMirrorServer;Initial Catalog=myDataBase;Integrated Security=True

Asynchronous processing

  1. Server=myServerAddress;Database=myDataBase;Integrated Security=True;Asynchronous Processing=True;  

SQL Server 2005 specials [ context connection ]

C#代码

  1. using(SqlConnection connection = new SqlConnection("context connection=true"))  
  2.  {  
  3.      connection.Open();  
  4.        
  5.  } 

Visual Basic代码

  1. Using connection as new SqlConnection("context connection=true")  
  2.      connection.Open()  
  3.        
  4.  End Using