{
String query = "select * from transaction where DATE(paid_date)BETWEEN '" + fromdate + "'AND'" + todate + "' AND(customer_id='" + customer + "' OR card_id='" + card + "')";
con.Open();
MySqlDataAdapter da = new MySqlDataAdapter(query, con);
DataTable dt = new DataTable();
da.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.DataBind();
}
Uncomment the
DataBind()
. Because after assigning the source to the GridView, you
must bind the data to it, so that GridView can hold the data within it.
-KR