示例#1
0
        // Go to user details page function
        private void button4_Click(object sender, EventArgs e)
        {
            SqlConnection con   = new SqlConnection(@"Server=localhost;Database=BankApplication;Trusted_Connection=True;");
            String        Query = "Select * from dbo.User_Data Where Username = '******'";
            SqlCommand    cmd   = new SqlCommand(Query, con);

            cmd.CommandType = CommandType.Text;
            cmd.Connection  = con;
            con.Open();
            try
            {
                using (SqlDataReader sdr = cmd.ExecuteReader())
                {
                    label3.Visible = false;
                    sdr.Read();
                    GetUserDetails eForm = new GetUserDetails();
                    eForm.passingvalue  = Username;
                    eForm.passingvalue1 = sdr["PhoneNumber"].ToString();
                    eForm.passingvalue2 = sdr["PinNumber"].ToString();
                    eForm.passingvalue3 = sdr["BalanceAmount"].ToString();
                    //eForm.passingvalue4 = sdr[5];
                    sdr.Close();
                    Hide();
                    con.Close();
                    eForm.Show();
                }
            }

            catch {
            }
            con.Close();
        }
示例#2
0
        private void button3_Click_1(object sender, EventArgs e)
        {
            Hide();
            GetUserDetails eForm1 = new GetUserDetails();
            EnquiryForm    eForm  = new EnquiryForm();

            eForm.Username     = Username;
            eForm1.GetUsername = Username;
            eForm.Show();
        }