Exemple #1
0
 private DB checkDatabase()
 {
     string server = txt_server.Text.Trim();
     string port = txt_port.Text.Trim();
     string userid = txt_userid.Text.Trim();
     string pwd = txt_pwd.Text.Trim();
     string dbname = txt_dbname.Text.Trim();
     DB db = new DB(server, port, userid, pwd, dbname);
     string msg = db.test();
     if (null == msg)
     {
         return db;
     }
     else
     {
         MessageBox.Show("���ݿ�����ʧ�ܣ�" + msg);
         return null;
     }
 }
Exemple #2
0
 public Form2(DB db)
 {
     InitializeComponent();
     this.db = db;
 }