try this:-
string str1 = "select due_date from mConfirm where emp_id='" + s + "'";
sda = new SqlDataAdapter(str1, cn);
ds = new DataSet();
sda.Fill(ds);
string d = ds.Tables[0].Rows[0].ItemArray[0].ToString();
if ((Convert.ToDateTime(d)- DateTime.Today)>=2)
{
LblAlreadyExists.Text = "Already Under Process";
}
else
{
LblAlreadyExists.ForeColor = System.Drawing.Color.Red;
LblAlreadyExists.Text = "RECORD ALREADY EXISTS";
CHKConfirmed.Enabled = false;
BtnConfirmd.Enabled = false;
}
Convert.ToDateTime(d)- DateTime.Today
This subtracts two DateTime. The result is a TimeSpan object which has a Days property.
I hope this will work.