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

推荐订阅源

V
Visual Studio Blog
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
P
Privacy International News Feed
Cyberwarzone
Cyberwarzone
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
The Last Watchdog
The Last Watchdog
V2EX - 技术
V2EX - 技术
Schneier on Security
Schneier on Security
B
Blog RSS Feed
N
News and Events Feed by Topic
T
The Blog of Author Tim Ferriss
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
云风的 BLOG
云风的 BLOG
L
Lohrmann on Cybersecurity
小众软件
小众软件
T
Threat Research - Cisco Blogs
F
Full Disclosure
P
Palo Alto Networks Blog
Latest news
Latest news
Scott Helme
Scott Helme
T
Tailwind CSS Blog
M
MIT News - Artificial intelligence
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Recent Announcements
Recent Announcements
Hacker News - Newest:
Hacker News - Newest: "LLM"
H
Hacker News: Front Page
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The Register - Security
The Register - Security
J
Java Code Geeks
The Cloudflare Blog
美团技术团队
博客园 - 【当耐特】
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tor Project blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Security Latest
Security Latest
S
Securelist
Webroot Blog
Webroot Blog
博客园 - 三生石上(FineUI控件)
P
Privacy & Cybersecurity Law Blog
N
Netflix TechBlog - Medium
C
Check Point Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
H
Help Net Security
I
InfoQ
L
LINUX DO - 热门话题

博客园 - 网际浪人

.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