protected void Page_Load(object sender, EventArgs e)
        {
            DBconnection dbg = new DBconnection();
            string       q   = "Select * from UserInfo where UserEmail='" + SignIn.ema + "'";
            DataTable    dt  = dbg.getData(q);

            ab            = Convert.ToInt32(dt.Rows[0]["UserID"]);
            lblName.Text  = dt.Rows[0]["UserName"].ToString();
            lblPhone.Text = dt.Rows[0]["UserPhone"].ToString();;
            lblEmail.Text = dt.Rows[0]["UserEmail"].ToString();;
            lblDOB.Text   = dt.Rows[0]["UserDob"].ToString();;
            DBconnection dba  = new DBconnection();
            string       ageq = "Select DATEDIFF(YY,UserDob,GETDATE()) From UserInfo where UserEmail='" + lblEmail.Text + "'";
            DataTable    dta  = dba.getData(ageq);

            lblAge.Text = dta.Rows[0][0].ToString();
        }
Esempio n. 2
0
        protected void btnShow_Click(object sender, EventArgs e)
        {
            DBconnection dbv = new DBconnection();
            string       query;

            if (ddOptions.SelectedValue == "UserAccounts")
            {
                query = "Select UserID, UserName,UserEmail,UserDob,UserPhone from UserInfo";
            }
            else
            {
                query = "Select * from Loans";
            }
            DataTable dtr = dbv.getData(query);

            dgvRecords.DataSource = dtr;
            dgvRecords.DataBind();
        }