Example #1
0
        public void OutputQueryToCsv()
        {
            ICsvWriter csv     = CsvWriter.Create(path: _root + "output_from_table.csv", queryString: "SELECT * FROM dbo.TestTable", connectionString: _connectionString);
            bool       success = csv.OutputToCsv();
            string     error   = csv.Error;

            csv.Dispose();

            if (error != null)
            {
                throw new Exception(error);
            }

            Assert.IsTrue(success);
        }
Example #2
0
        public void Close()
        {
            if (_csvWriter != null)
            {
                _csvWriter.Dispose();
                _csvWriter = null;
            }

            if (_csvReader == null)
            {
                return;
            }

            _csvReader.Dispose();
            _csvReader = null;
        }
 public void Dispose()
 {
     csvWriter.Dispose();
 }
 public void Close()
 {
     _csvWriter?.Dispose();
 }