WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('in-progress') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

WordPress database error: [Table './ay6u3nor6dat6ba1/kn6_ayu1n9k4_5_actionscheduler_actions' is marked as crashed and last (automatic?) repair failed]
SELECT a.action_id FROM kn6_ayu1n9k4_5_actionscheduler_actions a WHERE 1=1 AND a.hook='aioseo_send_usage_data' AND a.status IN ('pending') ORDER BY a.scheduled_date_gmt ASC LIMIT 0, 1

Calculate difference between two dates by DateTimePicker in C# | Loop and Break

Calculate difference between two dates by DateTimePicker in C#

The following code find out difference in days between two date time pickers selected date.

Step 1 :

Place two date time pickers in your C# windows form.

Step 2:

Place a button which calculates difference on pressing(event firing)

Step 3:

Place a label to display difference between two dates.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            // convert difference to string 
            label1.Text = Convert.ToString((dateTimePicker2.Value - dateTimePicker1.Value).TotalDays);
        }
    }
}

Output

Share

You may also like...

1 Response

  1. Salik says:

    Thanx, but on the lable getting the decimal value (18-05-2014)-(15-05-2014)=2.9999999999981;