.NET连接各种数据库的连接字符串

1、连接SQL Server:

  • Standard Security

Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;

  • Trusted Connection

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

  • Connection to a SQL Server instance

Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;Password=myPassword;

2、连接MySql: 

  • Standard

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

  • Specifying TCP port

Server=myServerAddress;Port=1234;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

  • Multiple servers

Server=serverAddress1, serverAddress2, serverAddress3;Database=myDataBase;Uid=myUsername;Pwd=myPassword;


.NET连接各种数据库的连接字符串_第1张图片 

你可能感兴趣的:(.Net相关)