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
Suthish NairPosted Sep 13, 2013, 5:35 AM
ta muPosted Sep 11, 2013, 1:12 PM
Suthish NairPosted Sep 11, 2013, 9:18 AM
Prasenjit DeyPosted Sep 11, 2013, 6:21 AM
http://www.aspdotnet-suresh.com/2011/06/creating-windows-service-in-c-or.html
ta muPosted Sep 11, 2013, 5:35 AM
Sanjeeb LenkaPosted Sep 11, 2013, 5:01 AM
for this you have to use Windows service.
Prasenjit DeyPosted Sep 11, 2013, 4:52 AM