Verify the data from the last element of xpath with dynamic list c#
<p><a href="https://i.stack.imgur.com/F7dSq.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F7dSq.jpg" alt="DataList"></a></p>

<p>From the above image the new data that I add gets added to the last page but there can be similar name and I need to verify the data using the ID as shown. So I am trying to figure out the way to store text values from the id and when the new data is added it should verify the last newly added ID. Any ideas? </p>

<pre><code>        int i = 1;
        bool found = false;
        string ID;
        try
        {

            IWebElement LastPage = Driver.driver.FindElement(By.XPath("html/body/div[4]/div/div/div[2]/table/tbody/tr[8]/td[1]"));
            LastPage.Click();
            for (i = 1; i &lt;= 10; i++) ;
            {
                ID= Driver.driver.FindElement(By.XPath("html/body/div[4]/div/div/div[2]/table/tbody/tr[" + i + "]/td[1]")).Text;
                if (??)
            }
</code></pre>