예제 #1
0
파일: Nhs.cs 프로젝트: radtek/wscope
 public Nhs()
 {
     oplog = OperLog.instance;
     sb = new StringBuilder();
     dbconf = OraConf.instance.DBs[0];
     //file = nhsfile;
 }
예제 #2
0
파일: OraZip.cs 프로젝트: radtek/wscope
        private void button1_Click(object sender, EventArgs e)
        {
            OracleDatabase db        = null;
            string         constring = "user id=hs_fund;password=handsome;data source=devgh";
            OperLog        oplog     = OperLog.instance;

            try
            {
                // Create an instance of an OracleDatbase object
                db = new OracleDatabase(constring);

                // Start up the database
                //db.Startup();

                Console.WriteLine("The Oracle database is now up.");

                // Executing Startup() is the same as the following:
                // db.Startup(OracleDBStartupMode.NoRestriction, null, true);
                // which is also the same as:
                // db.Startup(OracleDBStartupMode.NoRestriction, null, false);
                db.ExecuteNonQuery("");
                // db.ExecuteNonQuery("ALTER DATABASE OPEN");
            }
            catch (OracleException ex)
            {
                string err = "连接Oracle数据库失败,TNSNAME:racle异常信息:" + ex.Message;
                oplog.WriteLog(err, LogLevel.Error);
                System.Windows.Forms.MessageBox.Show(err);
            }
            catch (Exception ex)
            {
                string err = "连接Oracle数据库失败,TNSNAME:异常信息:" + ex.Message;
                oplog.WriteLog(err, LogLevel.Error);
                System.Windows.Forms.MessageBox.Show(err);
            }
            finally
            {
                // Dispose the OracleDatabase object
                db.Dispose();
            }
        }
예제 #3
0
파일: OraConf.cs 프로젝트: radtek/wscope
 private OraConf()
 {
     log = OperLog.instance;
     DBs = new List<DBConf>();
     // 加载配置文件
     LoadConf();
 }