Is it possible to create an array list of datatables?
I have a function that I want to loop through the datatables in my datasets, however I need to know in what order, for this I thought if I could populate the array with the datatables I could then loop through that. However i cannot seem to add a datatable to an arraylist.
Code:public static ArrayList[] sheetDataMappings = new ArrayList[1]; public static ArrayList[] sheetColumnMappings = new ArrayList[1]; public static ArrayList[] sheetFunctionMappings = new ArrayList[1]; public static ArrayList columnMappings = new ArrayList(9); public static ArrayList sheettableMappings = new ArrayList(1); public static ArrayList functionMappings = new ArrayList(1); public static DataTable datatable1; static ThisReport() { columnMappings.Add(new ColumnMapping("audit_id", 1)); columnMappings.Add(new ColumnMapping("audit_date", 2)); columnMappings.Add(new ColumnMapping("duration", 3)); columnMappings.Add(new ColumnMapping("report_name", 4)); columnMappings.Add(new ColumnMapping("username", 5)); columnMappings.Add(new ColumnMapping("parameters", 6)); columnMappings.Add(new ColumnMapping("version_client", 7)); columnMappings.Add(new ColumnMapping("version_server", 8)); columnMappings.Add(new ColumnMapping("status", 9)); sheetColumnMappings[0] = columnMappings; sheetFunctionMappings[0] = functionMappings; datatable1 = (DataTable)Globals.ThisWorkbook.ds.UP_CRSUsageAudit; sheetColumnMappings[0] = datatable1; }





Reply With Quote