public void dbconn() { if (cnn_ == null) { var dbType = ConfigurationManager.AppSettings["P_DBTYPE"]; var connSetting = ConfigurationManager.ConnectionStrings["default"]; if (connSetting == null) { throw new MyException(JDApiBase.E_SERVER, "No db connectionString defined in web.config"); } cnn_ = new DbConn(); cnn_.onExecSql += new DbConn.OnExecSql(delegate(string sql) { api.addLog(sql, 9); }); cnn_.Open(connSetting.ConnectionString, connSetting.ProviderName, dbType); cnn_.BeginTransaction(); } }
public void init(DbConn cnn) { m_cnn = cnn; }