internal static DataTable FillingTable(string InitialCatalog) { int rowsCount = CurrentRowsCount; var newTable = new DataTable(currentTable.TableName); string query = $"Select * from {currentTable.TableName}"; _adapter = DataAdapter.GetAdapter(InitialCatalog, query); try { _adapter.Fill(startRows, (rowsCount + fillingStep), newTable); } catch (SqlException e) { throw new Exception(e.Message); } catch (Exception e) { throw new Exception("Неизвестная ошибка", e); } currentTable = newTable; return(newTable); }
internal static DataTable GetNewTable(string InitialCatalog, string tableName, int start, int maxRows) { currentTable = new DataTable(tableName); string query = $"Select * from {tableName}"; startRows = start; _adapter = DataAdapter.GetAdapter(InitialCatalog, query); try { _adapter.Fill(startRows, maxRows, currentTable); } catch (SqlException e) { throw new Exception(e.Message); } catch (Exception e) { throw new Exception("Неизвестная ошибка", e); } return(currentTable); }