2
Answers

getting data between two dates

sandeep sandy

sandeep sandy

8y
249
1
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)