from the correct line from my initated file from line 6? Here's my code:
- protected void Page_Load (object sender, EventArgs, and)
- {
- }
- protected void import_Click (object sender, EventArgs and)
- {
- DataTable Data = new DataTable ();
- if (selectFileContent! = null)
- {
- string Excel = AppDomain.CurrentDomain.BaseDirectory + select File.FileName;
- select File.SaveAs (Excel);
- Data = Excel Data (Excel);
- var recordsValid = ((DataTable) Data) .Rows.OfType
(). Skip (5); - // Delete the last line
- recordsValid = RecordsValid.Take (RecordsValid.Count () - 1);
- // read 100 out of 100 records
- int amount_for_page = 100;
- int total_of_page;
- // Count valid records
- int qtd_total_registers = recordsValids.Count ();
- // Perform mathematical calculations for total pages.
- total_of_pages = (int) Math.Ceiling ((double) qtd_total_records / amount_by_page);
- if (recordsValid.Count ()> 0)
- {
- bool layoutValid = CheckLayout (Data);
- if (! layoutValid)
- ClientScript.RegisterStartupScript (typeof (string), "Error", "