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.Prevent reading last Blank row from Excel file in ASP.Net C#<p>This is due to a blank row in your Excel. So before proceeding with code first you need to check the ex_id for null or empty. If not null or empty then proceed with your code.</p> <pre class="brush: csharp">while (dr.Read()) { if(!string.IsNullOrEmpty(dr[0].ToString())) { // Your code. } }</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/135641/Prevent-reading-last-Blank-row-from-Excel-file-in-ASPNet-C/https://www.aspforums.net:443/Threads/135641/Prevent-reading-last-Blank-row-from-Excel-file-in-ASPNet-C/Mon, 12 Mar 2018 06:24:51 GMT