this is code which i am using for reminder option. but it only works when pc remain running how to convert that code if i restart my computer
it starts working agin.
public DateTime mytime;
private void timer1_Tick(object sender, EventArgs e)
{
if (mytime.CompareTo(DateTime.Now) < 0)
{
this.Show();
}
}
private void button1_Click(object sender, EventArgs e)
{
mytime = monthCalendar1.SelectionStart.AddHours(dateTimePicker1.Value.Hour).AddMinutes(dateTimePicker1.Value.Minute).AddSeconds(dateTimePicker1.Value.Second);
if (textBox1.Text!="")
{
SqlCommand cmd = new SqlCommand("INSERT INTO reminder (message,date,time) VALUES ('" + textBox1.Text + "','" + monthCalendar1.SelectionStart + "','" + dateTimePicker1.Value + "')", my);
cmd.ExecuteNonQuery();
this.Hide();
}
else
{
MessageBox.Show("Enter A Messag");
}
Loading

Prasenjit DeyRank #6,279 · 271 reputationPosted Sep 11, 2013, 12:52 AM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 11, 2013, 1:01 AM EDT
for this you have to use Windows service.
ta mu198 reputationPosted Sep 11, 2013, 1:35 AM EDT
Prasenjit DeyRank #6,279 · 271 reputationPosted Sep 11, 2013, 2:21 AM EDT
http://www.aspdotnet-suresh.com/2011/06/creating-windows-service-in-c-or.html
Suthish NairRank #92 · 22.8K reputationPosted Sep 11, 2013, 5:18 AM EDT
ta mu198 reputationPosted Sep 11, 2013, 9:12 AM EDT
Suthish NairRank #92 · 22.8K reputationPosted Sep 13, 2013, 1:35 AM EDT