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

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - 网际浪人

.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