/// <summary> /// Hopefully this function will find the ID from Firstname and LastName, will return -1 if it can't find id. /// </summary> /// <param name="FN"> FirstName</param> /// <param name="LN"> LastName</param> /// <returns></returns> private static int FindID(string FN, string LN) { int id = -1; DataTable aaa = ElectionDBClass.VotersTable(); foreach (DataRow dr in aaa.Rows) { if (dr[1].ToString() == FN && dr[2].ToString() == LN) { id = (int)dr[Convert.ToInt32(0)]; break; } else { return(-1); } } return(id); }