using (MySqlCommand cmd = new MySqlCommand("SELECT * FROM completeup WHERE Date_Time_Down >= @FromDate and Date_Time_Down <= @ToDate", con))
{
using (MySqlDataAdapter da = new MySqlDataAdapter(cmd))
{
cmd.Parameters.AddWithValue("@FromDate", (this.frtxt2a.Text));
cmd.Parameters.AddWithValue("@ToDate", (this.Totxt2a.Text));
excelbtn.Enabled = true;
DataSet ds = new DataSet();
da.Fill(ds);
CmpleHisGV.DataSource = ds;
CmpleHisGV.EmptyDataText = "No Record(s) Found";
CmpleHisGV.DataBind();
}
}
C# learner
|