public IList <CovalcoDTO> GetAllData() { try { return(SqlCmd.NewTextCommand(this._conn.DatabaseConnString) .SetCommandText(@"SELECT TOP (1000) [AirportCode] ,[CurrencyCode] ,[Rate] ,[TaxAmount] ,[RTOrder] ,[Details] ,[CountryCode] ,[TaxCode] ,[TaxDefinition] ,[RemittanceBySelling] ,[RemittanceByLifting] ,[AppliedOnDeparture] ,[AppliedOnArrival] ,[LastModified] ,[InsertedDate] FROM [Connectio].[dbo].[CovalcoDetails]") .Execute().ToList <CovalcoDTO>()); } catch (Exception ex) { throw new SqlServerException("", ex); } }
private void truncateTable(string tableName) { try { SqlCmd.NewTextCommand(_conn.DatabaseConnString).SetCommandText($"Truncate Table {tableName}").Execute(); } catch (Exception ex) { throw new Exception($"Error Truncating all data from {tableName} table", ex); } }