public void Render(TextWriter writer)
        {
            DataSet myDataset = new DataSet();

            _dataFill.Fill(myDataset);
            foreach (DataTable table in myDataset.Tables)
            {
                foreach (DataColumn col in table.Columns)
                {
                    writer.Write(col.ColumnName.PadRight(20) + " ");
                }
                writer.WriteLine();
                foreach (DataRow row in table.Rows)
                {
                    for (int i = 0; i < table.Columns.Count; i++)
                    {
                        writer.Write(row[i].ToString().PadRight(20) + " ");
                    }
                }
            }
        }
Beispiel #2
0
 public DataRepository(IDataFill dataFill, DataContext dataContext)
 {
     DataContext = dataContext;
     dataFill.Fill(dataContext);
 }