예제 #1
0
        public frmLoginServer showKetNoiCSDL()
        {
            frmLoginServer F = new frmLoginServer();

            F.ShowDialog();
            F.Activate();
            return(null);
        }
예제 #2
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     try
     {
         clsConnection.ReadKeys();
         if (clsConnection.ServerName == null || clsConnection.Databasename == null || clsConnection.LoginName == null || clsConnection.LoginPassword == null)
         {
             frmLoginServer F = new frmLoginServer();
             F.ShowDialog();
             if (frmLoginServer.isConnect == false)
             {
                 Application.Exit();
             }
             else
             {
                 DangNhapHeThong();
             }
         }
         else
         {
             if (clsConnection.IsCheckConnect(clsConnection.ServerName, clsConnection.Databasename, clsConnection.LoginName, clsConnection.LoginPassword) == false)
             {
                 frmLoginServer F = new frmLoginServer();
                 F.ShowDialog();
                 if (frmLoginServer.isConnect == false)
                 {
                     Application.Exit();
                 }
                 else
                 {
                     DangNhapHeThong();
                 }
             }
             else
             {
                 DangNhapHeThong();
             }
         }
     }
     catch (Exception Loi)
     {
         MessageBox.Show("Lỗi kết nối cơ sở dữ liệu", "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }