I have problems with converting these two mentioned types. could somebody give me the solution please?
This is the code:
int INT32ID = int.Parse(dataGridView1.CurrentRow.Cells[2].Value.ToString());
int StudentID = **Convert.ToInt64(INT32ID);**(here is the error)
var Student = DB.Students.Find(StudentID);
DB.Entry(Student).State = EntityState.Deleted;
And here is what the error says:
Cannot implicitly convert type 'long' to 'int'. An explicit conversion exists (are you missing a cast?)