Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. protected void Button1_Click(object sender, EventArgs e)
  2. {
  3. string myConnection = "datasource=blahblah;port=blahblah;username=blahblah;password=blahblah";
  4. MySqlConnection con = new MySqlConnection(myConnection);
  5. MySqlCommand cmd = new MySqlCommand("SELECT * FROM purchase_history_table WHERE student_id LIKE '%" + this.TextBoxstudentid.Text + "%' ;", con);
  6. DataTable dt1 = new DataTable();
  7. MySqlDataAdapter adp = new MySqlDataAdapter(cmd);
  8. adp.Fill(dt1);
  9. GridView1.DataSource = dt1;
  10. GridView1.DataBind();
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement