Hii want to increase the value once in every month.there is no error ..but i didn't get correct result ..if i login the application it will increase and again login in same day it will again increasinghere is my code:MySqlCommand Cm;
cn.Open();
MySqlDataAdapter da = new MySqlDataAdapter("select * from leavesummary1 where empcode ='" + Label13.Text + "' ", cn);
DataSet ds = new DataSet();
da.Fill(ds);
int iCurrentMonth = DateTime.Now.Month;
int iCurrentdate = DateTime.Now.Day;
foreach (DataRow dr in ds.Tables[0].Rows)
{
string str = dr["Privilege"].ToString();
Double t = Convert.ToDouble(str);
string str2 = dr["sick"].ToString();
double t1 = Convert.ToDouble(str2);
string str3 = dr["casual"].ToString();
double t2 = Convert.ToDouble(str3);
// Label3.Text = Convert.ToString(t);
if ((iCurrentdate == 1) || (iCurrentdate == 2))
// DateTimeOffset date2 = new DateTimeOffset(2015, 2, 3, 4, 40,45, TimeSpan.Zero);
//int months = date.Subtract(date1).Days / 30;
if ((iCurrentMonth == 3) || (iCurrentMonth == 9))
{
double Dates = Convert.ToDouble(2.5 + t);
Label3.Text = Convert.ToString(t + 2.5);
}
else if ((iCurrentMonth == 6) || (iCurrentMonth == 12))
{
// double Dates = Convert.ToDouble(2 + t);
Label3.Text = Convert.ToString(t + 2);
}
else
{
// double Dates = Convert.ToDouble(1.5+ t);
Label3.Text = Convert.ToString(t + 1.5);
}
Label1.Text = Convert.ToString(0.5 + t1);
Label2.Text = Convert.ToString(0.5 + t2);
}
else
{
Label3.Text = Convert.ToString(t);
Label1.Text = Convert.ToString(t1);
//double dayss = Convert.ToDouble(0.5 );
Label2.Text = Convert.ToString(t2);
}
}