sandeep sandy

sandeep sandy

  • NA
  • 18
  • 6.7k

getting data between two dates

May 19 2016 4:57 AM
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();
}
}
}
}
---------------------------------------------- 

Attachment: Untitled.zip

Answers (2)