ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Avoid (Prevent) duplicate record insert into DataTable using C# in ASP.Net<blockquote><cite>akhter says:</cite> <pre>foreach (DataRow dr in dt.Rows) { if (dr2["Prdno"].ToString() == TextBox1.Text.Trim()) { ifExist = true; } }</pre> </blockquote> <p>Change above with below code.</p> <pre class="brush: csharp">foreach (DataRow dr in dtgridview.Rows) { if (dr[&#34;Prdno&#34;].ToString() == TextBox1.Text.Trim()) { ifExist = true; break; } }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/122822/Avoid-Prevent-duplicate-record-insert-into-DataTable-using-C-in-ASPNet/https://www.aspforums.net:443/Threads/122822/Avoid-Prevent-duplicate-record-insert-into-DataTable-using-C-in-ASPNet/Tue, 20 Aug 2019 08:44:05 GMT