Click here to Skip to main content
15,902,876 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to upload Excel file to DataTable.If Excel File is empty then return File is Empty.(Even user typed in cells and delete all the data and make it to be empty then display file is empty.)

I used Contentlength and Fileinfo.But it is not useful.

C#
if (file.ContentLength > 0)
is not give a solution


C#
FileInfo info = new FileInfo(LocalFilePath);
                   long value = fileName.Length;

                   if (value > 0)
                  {

It is also not work

Pls Give me a good solution.

Thanks in advance
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900