Example #1
0
        private void BindingMyData()
        {
            MySqlConnection Mycon = new MySqlConnection(myDatabase);

            Mycon.Open();
            MySqlDataAdapter sqlDataAdapter = new MySqlDataAdapter("select * from EntrepreneurialTechnology.User", Mycon);
            DataTable        MyDataTable    = new DataTable();

            sqlDataAdapter.Fill(MyDataTable);
            GridViewAllUser.DataSource = MyDataTable;
            GridViewAllUser.DataBind();
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UsernameAdmin"] != null)
            {
                LinkAdminLogout.Visible        = true;
                linkViewAllAppointment.Visible = true;
                linkAdminUsername.Text         = "Hello " + Session["UsernameAdmin"];

                MySqlConnection Mycon = new MySqlConnection(myDatabase);
                Mycon.Open();
                MySqlDataAdapter sqlDataAdapter = new MySqlDataAdapter("select * from EntrepreneurialTechnology.User", Mycon);
                DataTable        MyDataTable    = new DataTable();
                sqlDataAdapter.Fill(MyDataTable);
                GridViewAllUser.DataSource = MyDataTable;
                GridViewAllUser.DataBind();
            }
        }