Hello guys am having a problem while reading data from excel using Jet oledb in my MVC web application. My application has an option to upload excel file
Here is my code for constructing connection string
if (0 == extension.CompareTo(".xls"))
{
connString = ConfigurationManager.ConnectionStrings["MicrosoftProviderForxls"].ConnectionString +
fileName + ConfigurationManager.ConnectionStrings["MicrosoftPropertyForxls"].ConnectionString;
}
The value of connectionstring is
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\20_18_18_26.xls;Extended Properties=Excel 8.0"
Which works fine giving me number of rows read correctly. The issue occusrs when delete some rows from that excel file by selecting some rows and pressing "Backspace" or using delete option in excel
Here the number of rows read is returning as incorrect as if no rows are deleted.
How can I solve this? Do I Need to add any parameters to connection string to make sure that empty rows are not counted