C# 的 SQLServer 連接字符運(yùn)用如下:
string cString = "Data Source=服務(wù)器名;Initial Catalog=庫(kù)名;User ID=XX;Password=XX;";
SqlConnectionconn = new SqlConnection();
conn.ConnectionString
= cString;conn.Open();
以PB默認(rèn)的數(shù)據(jù)庫(kù)連接實(shí)例SQLCA為例
//連接參數(shù)設(shè)置
SQLCA.DBMS = "MSS Microsoft SQL Server"
SQLCA.Database = "dbname" //數(shù)據(jù)庫(kù)名稱
SQLCA.LogPass = 逗地//用戶密碼
SQLCA.ServerName = "192.168.0.251"
SQLCA.LogId = "sa"http://SQLserver用戶名
SQLCA.AutoCommit = True
SQLCA.DBParm = ""
//連接
CONNECT USING SQLCA;