Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to Import from and Export to Excel file in Asp.Net Core in Visual Studio 2015?

$
0
0

I am trying to import the contents from the Excel file to datatable and export some modified contents again to the Excel Spreadsheet?

I have tried almost all means, IExcelDataReader not found, no packages compatible for .net core App

Gembox.Spreadsheet, Microsoft.Office.Interop.Excel etc 

Is there any way to achieve it?

I have got the excel file Filestream fs, how to copy the contents to a datatable?

Similarly, how to write the contents of datatable to Excel file in filestream?

My Function Code

                              string FilePath;
                              using (FileStream filestream = new FileStream(Path.Combine(uploads, file.FileName), FileMode.Create))
                              {
                                               await file.CopyToAsync(filestream);
                                               FilePath = ""+ _environment.WebRootPath + "Uploads" + file.FileName;

                              }
                              using (FileStream FS = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.None))
                              {
                                        //IExcelDataReader excelReader;
                                           DataTable DT;

                              }
    


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>