What is the fastest way to export DataGridView rows in the range of 460328 - 800328 to Excel or into an SQL Server database table with out using Microsoft office interop as
Check out Create Excel files from C# without office as this refers to using EPPlus which works very well - I was able to create my CSV data from the data table and the bulk load in memory the Excel file to stream out. Simply a few lines of code. Varible csvData is string value of all your csvData.
using( ExcelPackage pck = new ExcelPackage( ) )
{
//Create the worksheet
ExcelWorksheet ws = pck.Workbook.Worksheets.Add( "Sheet1" );
// set the delimiter
etf.Delimiter = ',';
etf.EOL = "\n";
etf.TextQualifier = "\"";
//Load the datatable into the sheet, starting from cell A1. Print the column names on row 1
ws.Cells["A1"].LoadFromText( csvData, etf );
return pck.GetAsByteArray( );
}