Fetch the data from an excel .xls file -
Let's create an excel file with few rows and save it as Excel 97-2003 Workbook (*.xls) in your system.
For the reference both the excel files will look like with some sample records-
Step 1 - Let's create an interface which will contain two buttons for Refresh data from .xls and Refresh data from .xlsx respectively.
Step 2 - Create a gridview in Asp.Net which will present the data fetched from the excel.
Source code for the reference
Step 3 - Required name spaces -
For .xls file type
Difference in logic - In both the logic only difference is in the connection strings which is highlighted in the above explanation else everything remains same.
At the Interface - Once all the source code writing and logic building have been completed then run the application. and click on the respective buttons. The user screen or web site should be look like the below screen shot -
I hope the above explanation make you comfortable with the data handling on excel file types .xls and .xlsx respectively.
Please share your comments for any further information/help.