It is not possible for the ASP.NET Web app to obtain the data directly from the Excel file located in user's PC.
I have an Excel file in my system with some data. I want to write a code that will fetch the data from the Excel and write into a table in SQL Server.
As one of possible ways to realize the above-mentioned requirement, I suggest the followings:
(1) develop a desktop app such as Windows Forms which can open the Excel file, read data as required and send the data to the ASP.NET app using HttpClient at the client side, and
(2) add API in the ASP.NET app which can receive the data sent by the desktop app and save the received data to the database at the server side.