private void btnNumRoom_Click(object sender, EventArgs e) { int numofrooms = Convert.ToInt32(cboNumRoom.SelectedItem); houselist = admin.Searched_by_Number_of_Rooms(admin.Search_All_Houses(), numofrooms); if (houselist.Count() != 0) { gridAll.DataSource = houselist; } else { MessageBox.Show("There is no result with the condition", "NO RESULT", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }