Depending on the amount of data in your table you might find it quicker to use something like the following in place of your loop:
string selectString = string.Format("year_name = {0}", txt_add_year.Text);
DataRow[] yearsFound = dt.Select(selectString);
if (yearsFound.Length > 0)
{
}
else
{
}