private void show_reminders()
{
DateTime dt=DateTime.Today;
using (SqlConnection con = new SqlConnection(Connectionstring.Connection))
{
string query = "select count(InteractionID) from Table_Interaction where reminderDate >= @date and reminderDate < dateadd(day, 1, @date) ";
using (SqlCommand cmd = new SqlCommand(query, con))
{
cmd.Parameters.Add("@date", dt);
con.Open();
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
label2.Text = string.Format("{0}", reader[0]);
}
}
}
}
|