Ejemplo n.º 1
0
    protected void ButtonCli_Click(object sender, EventArgs e)
    {
        conn.Open();
        MySqlCommand cmd = conn.CreateCommand();

        cmd.CommandType = CommandType.Text;
        cmd.CommandText = "select user_id, first_name, last_name, city, province, gender, age, status from clientaccepted";
        cmd.ExecuteNonQuery();
        DataTable        dtt = new DataTable();
        MySqlDataAdapter daa = new MySqlDataAdapter(cmd);

        daa.Fill(dtt);
        GridViewCli.DataSource = dtt;
        GridViewCli.DataBind();

        conn.Close();
    }
Ejemplo n.º 2
0
    protected void sortDSC_Click(object sender, EventArgs e)
    {
        conn.Open();
        MySqlCommand cmd = conn.CreateCommand();

        cmd.CommandType = CommandType.Text;
        cmd.CommandText = "Select user_id,first_name,last_name,username, gender, age, email from client where gender='female'";
        cmd.ExecuteNonQuery();
        DataTable        dtt = new DataTable();
        MySqlDataAdapter daa = new MySqlDataAdapter(cmd);

        daa.Fill(dtt);
        GridViewCli.DataSource = dtt;
        GridViewCli.DataBind();

        conn.Close();
    }