public object ConstructDataSetColumnDelegate(int ordinal, string name, string theNamespace, string caption, Type type, bool isNested, object parent, string strColumnXsdType) { object result = parent; DataTable dataTable; if (parent == null) { dataTable = this.dataset.Tables["rowsetTable"]; } else { dataTable = (parent as DataTable); } if (isNested) { DataColumn dataColumn = new DataColumn(name, typeof(int)); dataColumn.Caption = name; dataColumn.AutoIncrement = true; FormattersHelpers.SetColumnNamespace(dataColumn, theNamespace); dataTable.Columns.Add(dataColumn); string text = dataTable.TableName + name; DataTable dataTable2; if (!this.dataset.Tables.Contains(text)) { dataTable2 = new DataTable(text); dataTable2.Locale = CultureInfo.InvariantCulture; this.dataset.Tables.Add(dataTable2); } else { dataTable2 = this.dataset.Tables[text]; } DataColumn dataColumn2 = new DataColumn(text, typeof(int)); dataColumn2.Caption = text; dataTable2.Columns.Add(dataColumn2); this.dataset.Relations.Add(text, dataColumn, dataColumn2, false); result = dataTable2; } else { RowsetFormatter.AddColumn(dataTable, name, theNamespace, caption, type, this.setColumnTypes, strColumnXsdType, this.columnsToConvertTimeFor); } return(result); }
public object ConstructDataTableColumnDelegate(int ordinal, string name, string theNamespace, string caption, Type type, bool isNested, object parent, string strColumnXsdType) { object result = parent; if (parent == null) { if (isNested) { DataColumn dataColumn = new DataColumn(name, typeof(int)); dataColumn.Caption = name; dataColumn.AutoIncrement = true; FormattersHelpers.SetColumnNamespace(dataColumn, theNamespace); this.datatable.Columns.Add(dataColumn); result = this.datatable; } else { RowsetFormatter.AddColumn(this.datatable, name, theNamespace, caption, type, this.setColumnTypes, strColumnXsdType, this.columnsToConvertTimeFor); } } return(result); }