here is my code on button click please check the attachment below
--------------------------------------------------------------
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["con"].ConnectionString))
{
using (SqlCommand cmd = new SqlCommand("SELECT * FROM [piechart] where Date BETWEEN '" + txtDate.Text + "' AND '" +txtDate1.Text + "'"))
{
using (SqlDataAdapter sda = new SqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
sda.Fill(dt);
// GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}
}
---------------------------------------------- 
Rajeesh MenothRank #118 · 18.4K reputationPosted May 19, 2016, 1:57 AM EDT
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted May 19, 2016, 7:55 AM EDT