Please change your code as per below code
Datetime date1 = convert.toDate(ds1.Rows[temp]["m_schdate"].ToString());
temp++;
if (chk_date(date1.tostring(), conn))
{
MessageBox.Show(date1.tostring());
if (chk_late(date1.tostring(), conn))
{
int day = date1.day;
allowance[28,3] = 30;
allowance[29, 1] = 12.7M;
}
else
{
MessageBox.Show("Late! No pay.");
allowance[28,3] = 0;
}
Hope this will help.