/// <summary> /// 内存回收,参照BaseDbHelper /// </summary> public void Dispose() { // 关闭数据库连接 if (this._rtdbconnection != null) { if (this._rtdbconnection.State != ConnectionState.Closed) { this._rtdbconnection.Close(); this._rtdbconnection.Dispose(); } } this._rtdbconnection = null; }
public String Logon(string connectionString) { //带连接字符串的连接函数,采用传入参数connectionString进行连接。 if (this._rtdbconnection == null || this._rtdbconnection.State.ToString() != "Open") { this.ConnectionString = connectionString; this._rtdbconnection = new RTDBConnection(connectionString); this._rtdbconnection.Open(); this._iBase = new BaseImpl(this._rtdbconnection); this._iSnapshot = new SnapshotImpl(this._rtdbconnection); this._iHistorian = new HistorianImpl(this._rtdbconnection); this._iServer = new ServerImpl(this._rtdbconnection); } if (this._rtdbconnection.State.ToString() == "Open") { return("logon"); } else { return("logoff"); } }