国产97色在线|亚洲-欧美人妻另类制服丝袜-欧美人成国产91视频-殷素素一女战二夫|www.ycjrc.net

C# 常用數據庫連接字符串, SQL Server, MySQL, Oracle, Access mdb

發布時間:2020-08-07 05:08 作者:獨孤劍 閱讀:2231

C# 常用數據庫連接字符串, SQL Server, MySQL, Oracle, Access mdb
// SqlServer-Windows Authentication
string connectionString = "Data Source=127.0.0.1,1433;Initial Catalog=TestDB;connect timeout=10;Integrated Security=True";
// SqlServer-Account & Password
string connectionString = "Data Source=127.0.0.1,1433;Initial Catalog=TestDB;uid=sa;pwd=123456";

// MySql-Account & Password
string connectionString = "server=127.0.0.1;port=3306;database=TestDB;charset=utf8;user id=root;password=123456;pooling=false;";

// Oracle-Account & Password
string connectionString = "Data Source=(DESCRIPTION=(ADDRESS =(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1522))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=TestDB)));User Id=scott;Password=123456";

// Access-connect mdb
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Application.StartupPath + "\\Test.mdb" + ";Jet OLEDB:Database Password=123456;Persist Security Info=False";
// Access-connect accdb
string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Application.StartupPath + "\\Test.accdb" + ";Jet OLEDB:Database Password=123456;Persist Security Info=False";
// Access-connect mdb - ASP.NET(App_Data)
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"|DataDirectory|\\TestDB.mdb\";Jet OLEDB:database password=987654321;Persist Security Info=False";
// Access-connect accdb - ASP.NET(App_Data)
string connectionString = "Provider=Microsoft.Jet.OLEDB.12.0;Data Source=\"|DataDirectory|\\TestDB.accdb\";Jet OLEDB:database password=987654321;Persist Security Info=False";
// Access-connect mdb - ASP.NET
string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("~//Test.mdb") + ";Jet OLEDB:Database Password=123456;Persist Security Info=False";
// Access-connect accdb - ASP.NET
string connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("~//Test.accdb") + ";Jet OLEDB:Database Password=123456;Persist Security Info=False";


微信打賞, 微信掃一掃

支付寶打賞, 支付寶掃一掃

如果文章對您有幫助,歡迎給作者打賞

作者最新文章
開發過程中解決360兼容模式瀏覽器的方法
云南象群向西南方向遷移,云南離群獨象距離象群約12公里
吉林做網站最低價格,吉林企業網站建設價格低至500元起
守象人直擊云南象群最新動向
網站影響百度蜘蛛抓取量的因素有哪些?為什么我的網站Baidu蜘蛛來的次數少?
企業名片
在線客服