Exemplo n.º 1
0
        private void bunifuImageButton1_Click(object sender, EventArgs e)
        {
            mainLogin form = new mainLogin();

            form.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void btnSignOut_Click(object sender, EventArgs e)
        {
            this.Hide();
            mainLogin form1 = new mainLogin();

            form1.Show();
        }
Exemplo n.º 3
0
        private void load()
        {
            may  = txt_id.Text;
            user = txt_name.Text;
            pass = txt_pass.Text;
            try

            {
                string strConnectionString =                           // tạo chuỗi kết nối
                                             "Server =" + may + ";"    // lấy id máy server
                                             + "User Id=" + user + ";" // tên đăng nhập vào server
                                             + "Password="******"ket noi dc"
                //     , "Thông báo",
                //     MessageBoxButtons.OK,
                //     MessageBoxIcon.Information);
                i = true;
                //button1.Enabled = true;
                //db.ipServer = may;
                //db.user= user;
                //db.password = pass;

                daDatabase = new SqlDataAdapter(
                    "select * from master.sys.databases", conn);// chọn tất cả các database từ sever
                dtDatabase = new DataTable();
                dtDatabase.Clear();
                daDatabase.Fill(dtDatabase);                    // từ dataset đổ vào datatable
                conn.Close();
                //comboBox1.DataSource = dtDatabase;
                // comboBox1.DisplayMember = "name";
                // comboBox1.ValueMember = "name";
                this.Hide();
                mainLogin form2 = new mainLogin();
                form2.ShowDialog();
            }
            catch (SqlException)                                // kết nối bị lỗi xuất ra thông báo
            {
                MessageBox.Show(
                    "Không ket noi dc may tao bi hu r!!!"
                    , "Thông báo",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
        }