Exemplo n.º 1
0
        private DataTable _copyToDataTable(DataRow[] rows)
        {
            DataTable table = new DataTable();

            if (rows.Length > 1)
            {
                foreach (DataColumn col in this.Columns)
                {
                    DataColumn colNew = new DataColumn(col.ColumnName);
                    colNew.DataType = col.DataType;
                    table.Columns.Add(colNew);
                }

                foreach (DataRow existingRow in rows)
                {
                    DataRow newRow = table.NewRow();
                    foreach (DataColumn dc in this.Columns)
                    {
                        newRow[dc] = existingRow[dc.ColumnName];    // ????: I *think* I can't reuse the DataColumn here, maybe? Is dc === dc2?
                    }
                }
            }

            return table;
        }
Exemplo n.º 2
0
        private DataTable _dupeTableNoData()
        {
            DataTable dtOut = new DataTable();

            foreach (DataColumn col in this.baseTable.Columns)
            {
                DataColumn colNew = new DataColumn(col.ColumnName);
                colNew.DataType = col.DataType;
                dtOut.Columns.Add(colNew);
            }
            return dtOut;
        }
Exemplo n.º 3
0
 public DataView(DataTable baseTable)
 {
     this.baseTable = baseTable;
 }