示例#1
0
        public SqlServerWriterTests()
        {
            var row = new dcp.lib.Row();

            row.Add(1);
            row.Add("two");
            row.Add(new DateTime(1961, 3, 14, 1, 2, 3));
            rows.Add(row);
        }
示例#2
0
        private Row readRow(SqlDataReader reader)
        {
            var row = new dcp.lib.Row();

            for (var columnNumber = startColumnNumber; columnNumber <= endColumnNumber; columnNumber++)
            {
                row.Add(reader[columnNumber]); // the 0 row is the row number, which we don't want
            }
            nextRowNumber += 1;
            return(row);
        }
示例#3
0
文件: csv.cs 项目: Jonjump/dcp
 public CsvWriterTests()
 {
     row1 = new dcp.lib.Row();
     row1.Add(1);
     row1.Add("two");
     row1.Add(new DateTime(1961, 3, 14, 1, 2, 3));
     row2 = new dcp.lib.Row();
     row2.Add(1);
     row2.Add("two");
     row2.Add(new DateTime(1961, 3, 14, 1, 2, 3));
     stream = File.Create(TESTFILE);
 }
示例#4
0
文件: csv.cs 项目: Jonjump/dcp
        public void EscapesNewLine()
        {
            var row = new dcp.lib.Row();

            row.Add("newline\nstring");
            var opts = new dcp.lib.DataCopier.Options();
            var rows = new List <dcp.lib.Row>()
            {
                row
            };

            writeRows(opts, rows);

            Assert.Equal("\"newline\nstring\"\r\n", getResult());
        }