Excel Sheet Insert/Update Performance Comparison in C# - c#

Currently I am working on Excel sheet module of XXX project.
I need to optimize performance of Excel record insert and update because they have millions of record with very complex condition and many cell applying different formula.
So my problem is that which one is faster insert record with create new excel sheet or in edit mode insert record on already created xyz excel template.
Right now I am using NPOI plugin for creating excel file.

Related

Select specific rows from Multiple Excel workbooks, Each containing multiple worksheets. Then Writing the filtered rows to CSV or .xlsx

Initial format
I am needing to write a program using C#. It is my first project and could use some assistance please!!!
I have Multiple Workbooks which can have hundreds of sheets. Each Sheet for a Store within the specified region.
I am needing to select specific rows from each sheet using a ProductCode.
Note Sheets have merged and wrapped cells.
I am then required to write the data to a new CSV or MSExcel.xlsx
in Order to import into SQL Server.
desired result

OpenXML- Copy Formula is not working after generating excel file

I have created one application using openXML features to export excel file. Initially I tried to fill excel cell by cell but, I faced performance issue because of bulk data. Then I copied datatable content into Excel table.
Now I am able to generate bulk data.
But after generating excel file I am not able apply copy formula.

Database to Excel SSIS Dynamic creation

Explanation: I have an excel file that will be placed into a folder every day. There is normally about 5-7 worksheets inside that excel file. Each worksheet has the same column schema. I have an ssis package that extracts the data into a table and runs a procedure to several more columns of derived data to the original in the table. After the data has been added to the table i need to export it out into the excel file (Which will be the final complete report).
The ssis package has to For-Each Loops. One to loop through the excel files. and one inside that to loop through the sheets in the file. My initial idea was that i could just load straight from the database table back into the original excel file and overwrite all the data existing in there. Only problem is there is more columns in the table than can be mapped to the excel spreadsheet (because it originally only contains the 7 before the procedure is run). I have looked into dynamic excel creation but this seems over complicated for something that should be able to just be overwritten.
The process will work one sheet at a time, extract the data, build the extra data in the table, export the entire table back to the excel file. Rinse and repeat for the next several sheets in the excel file.
What would be the best approach for Reloading the data from the table back into the excel spreadsheet WITH the new columns also. Is dynamic excel sheet creation best for this? Or is there a better way to remap new columns to the existing spreadsheet and just add in the new data?
Thanks for the help in advance.

import the updated excel value to database

I have a large amount of data in a excel sheet which has about 2000 rows. I have imported the table in sql server with no error.
I have to modify the excel now and update the same changes in the database also.
I cant delete the table and import again since i have large amount of data and have extra columns added to it.
So Please help me how to update the new values along with the existing values. I use C#.Net.
Thanks
Import into a temp table and then use the MERGE statement to update your master table.

RecordId or any Other Unique id for a Excel File

I am developing an Application using vc++ and C# ,the application can Import and Export data to Excel file.
I am using Interop assemblies provided by microsoft. My Problem user imports data from excel and he modifies the data and when he is transfer back to excel ,then istead of creating a new row. My application should update the existing row which has the same data .
For example
I have an excel file which has 10 Colums and 100 rows . I am importing this to my application and I updating the data in 10th row . and I am exporting this back to the same excel file. My requirement is this should update the 10th row in my excel file.
My Doubt is in excel whether we have any record id which is unique to each row and this Id should not be created by user . I am using C# for Communicating with Excel. Is there any sample codes for it.
Thanks in advance
Then, when reading the data from the excel file, you would have to store the sheet name and row/column index.
There is no unique ID of a cell, just the cell name or the indices.

Categories

Resources