ASPForums.Net RSS Feed additions to the content that appears on ASPForums.Net(c) 2019 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>, 12 Mar 2018 06:24:51 GMT