I have to develop a project but when i enter this code block Kaspersky Internet Security alert me and delete exe file.
Here is the report:
this code i added after see virus:
foreach (DataGridViewRow idrow in dataGridView8.Rows)
{
TimeSpan diftime = new TimeSpan();
DateTime diftimson;
diftimson = Convert.ToDateTime(idrow.Cells[1].Value);
diftime = diftimson.Subtract(DateTime.Now);
double AradakiFark1 = diftime.Hours + Convert.ToInt32(idrow.Cells[4].Value);
int sonuc1 = Convert.ToInt32(AradakiFark1) / 24;
if (sonuc1 <= 3)
{
MessageBox.Show("3 Months Left For " + sonuc1 + " ", "ATTENTION !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
idrow.Cells[0].Style.BackColor = Color.Red;
idrow.Cells[0].Style.ForeColor = Color.White;
}
}
How can i fix it?

False-positive. Sometimes AV software detects wrongly. It has happened to most developers at some point.
You'll have to set the .exe/project folder as trusted.
Instructions:
Application preferences window
and
The Trusted Zone preferences window
(THese are links to the official docs for said AV software.)