public void DisplayResultColumnProperties(IResultColumn resultColumn, TreeNode resultColumnNode) { if (this._currentHashCode == resultColumn.GetHashCode()) { return; } DataTable dt = new DataTable("MyData"); dt.Columns.Add("Property", stringType); dt.Columns.Add("Value", stringType); dt.Rows.Add(new object[] { "Name", resultColumn.Name }); dt.Rows.Add(new object[] { "Alias", resultColumn.Alias }); dt.Rows.Add(new object[] { "Ordinal", resultColumn.Ordinal.ToString() }); dt.Rows.Add(new object[] { "DataTypeName", resultColumn.DataTypeName }); dt.Rows.Add(new object[] { "DataTypeNameComplete", resultColumn.DataTypeNameComplete }); dt.Rows.Add(new object[] { "LanguageType", resultColumn.LanguageType }); dt.Rows.Add(new object[] { "DbTargetType", resultColumn.DbTargetType }); this.Grid.DataSource = dt; this.InitializeGrid(); this.Text = "IResultColumn Properties"; this.lnkHELP.Text = "IResultColumn Help ..."; this.helpInterface = "IResultColumn"; this._currentHashCode = resultColumn.GetHashCode(); }
public void DisplayResultColumnProperties(IResultColumn resultColumn, TreeNode resultColumnNode) { if (this._currentHashCode == resultColumn.GetHashCode()) { return; } propGrid.SelectedObject = resultColumn; this._currentHashCode = resultColumn.GetHashCode(); }
private static DataTypeDefinitionRow GetType(IResultColumn srcCol, DataTypeDefinitionDataTable types) { // DataTypeName=Hyperlink, DataTypeNameComplete=Text (255) String dataTypeNameComplete = srcCol.DataTypeNameComplete .Replace(" ", "") .Replace("(", "_") .Replace(")", "_"); String dataTypeName = srcCol.DataTypeName .Replace(" ", "") .Replace("(", "_") .Replace(")", "_"); if (dataTypeNameComplete.Length == 0) { dataTypeNameComplete = dataTypeName; } if (dataTypeName.Length == 0) { dataTypeName = dataTypeNameComplete; } int baseTypeId = srcCol.DataType; if (baseTypeId == 0) { baseTypeId = Mapping.GetOleDbTypeIDFromOleDbTypeName(dataTypeNameComplete); } if (baseTypeId == 0) { baseTypeId = Mapping.GetOleDbTypeIDFromOleDbTypeName(dataTypeName); } // include System.XXXX DataTypeDefinitionRow baseType = types.IncludeDataTypeDefinition(Mapping.GetSystemTypeFromOleDBTypeID(baseTypeId), null); string oleTypeName = (baseTypeId != 0) ? Mapping.GetOleDBTypeNameFromID(baseTypeId) : null; if (oleTypeName != null) { baseType = types.IncludeDataTypeDefinition("sql." + oleTypeName, baseType.DataTypeName); } if (dataTypeName.Length > 0) { baseType = types.IncludeDataTypeDefinition("sql." + dataTypeName, baseType.DataTypeName); } baseType = types.IncludeDataTypeDefinition("app." + dataTypeNameComplete, baseType.DataTypeName); return(baseType); }
public static void ImportResultColumn(IResultColumn srcCol, TableDefinitionRow destTab) { DataTypeDefinitionRow dataType = GetType(srcCol, destTab.Table.DataSet.DataTypeDefinition); FieldDefinitionRow destField = destTab.FindFieldByAliasOrName(srcCol.Name); // destTab.Table.DataSet.FieldDefinition destTabs.FindByTableName(srcTab.Name); if (destField == null) { destField = destTab.FindFieldByAliasOrName(srcCol.Alias); } if (destField == null) { destField = destTab.AddFieldDefinitionRow(srcCol.Name, dataType.DataTypeName); } else { destField.DataTypeDefinitionRow = dataType; } destField.DBFieldType = "PROC_RETURN"; // destField.ReadOnly = true; //Exception on accessing srcCol.Alias destField.FieldAlias = srcCol.Alias; System.Diagnostics.Debug.WriteLine(string.Format( "FeldName={4}.{3}, DataTypeName={0}, DataTypeNameComplete={1}, DbTargetType={2}" , srcCol.DataTypeName , srcCol.DataTypeNameComplete , srcCol.DbTargetType , srcCol.Name , destTab.TableName)); /* destField.DataType = ???; * srcCol.DataType; // int * srcCol.DataTypeName; * srcCol.DataTypeNameComplete; * srcCol.DbTargetType; */ destField.SetDefaultValueNull(); destField.OriginalName = srcCol.Name; /** unsupported properties * destField.FieldExpression = srcCol.??? * destField.NullValue = srcCol.??? // nullvaluereplacement * destField.XmlFieldType = ???; // default is Attribute * * // srcCol.AllProperties; * srcCol.CharacterOctetLength; * srcCol.CharacterSetCatalog; * srcCol.CharacterSetName; * srcCol.CharacterSetSchema; * srcCol.CompFlags; * srcCol.Flags; * srcCol.GlobalProperties; * * srcCol.DateTimePrecision; // int * srcCol.HasDomain; * srcCol.Domain; // IDomain * srcCol.DomainCatalog; * srcCol.DomainName; * srcCol.DomainSchema; * srcCol.LanguageType; * srcCol.LCID; * srcCol.NumericPrecision; * srcCol.NumericScale; * srcCol.Ordinal; * srcCol.Properties; * srcCol.PropID; * srcCol.SortID; * srcCol.TDSCollation; * srcCol.TypeGuid; * srcCol.UserDataXPath; * */ }
public void DisplayResultColumnProperties(IResultColumn resultColumn, TreeNode resultColumnNode) { DataTable dt = new DataTable("MyData"); dt.Columns.Add("Property", stringType); dt.Columns.Add("Value", stringType); dt.Rows.Add(new object[] {"Name", resultColumn.Name}); dt.Rows.Add(new object[] {"Alias", resultColumn.Alias}); dt.Rows.Add(new object[] {"Ordinal", resultColumn.Ordinal.ToString()}); dt.Rows.Add(new object[] {"DataTypeName", resultColumn.DataTypeName}); dt.Rows.Add(new object[] {"DataTypeNameComplete", resultColumn.DataTypeNameComplete}); dt.Rows.Add(new object[] {"LanguageType", resultColumn.LanguageType}); dt.Rows.Add(new object[] {"DbTargetType", resultColumn.DbTargetType}); this.Grid.DataSource = dt; this.InitializeGrid(); this.Text = "IResultColumn Properties"; this.lnkHELP.Text = "IResultColumn Help ..."; this.helpInterface = "IResultColumn"; }
private static DataTypeDefinitionRow GetType(IResultColumn srcCol, DataTypeDefinitionDataTable types) { // DataTypeName=Hyperlink, DataTypeNameComplete=Text (255) String dataTypeNameComplete = srcCol.DataTypeNameComplete .Replace(" ", "") .Replace("(", "_") .Replace(")", "_"); String dataTypeName = srcCol.DataTypeName .Replace(" ", "") .Replace("(", "_") .Replace(")", "_"); if (dataTypeNameComplete.Length == 0) dataTypeNameComplete = dataTypeName; if (dataTypeName.Length == 0) dataTypeName = dataTypeNameComplete; int baseTypeId = srcCol.DataType; if (baseTypeId == 0) baseTypeId = Mapping.GetOleDbTypeIDFromOleDbTypeName(dataTypeNameComplete); if (baseTypeId == 0) baseTypeId = Mapping.GetOleDbTypeIDFromOleDbTypeName(dataTypeName); // include System.XXXX DataTypeDefinitionRow baseType = types.IncludeDataTypeDefinition(Mapping.GetSystemTypeFromOleDBTypeID(baseTypeId), null); string oleTypeName = (baseTypeId != 0) ? Mapping.GetOleDBTypeNameFromID(baseTypeId) : null; if (oleTypeName != null) baseType = types.IncludeDataTypeDefinition("sql." + oleTypeName, baseType.DataTypeName); if (dataTypeName.Length > 0) baseType = types.IncludeDataTypeDefinition("sql." + dataTypeName, baseType.DataTypeName); baseType = types.IncludeDataTypeDefinition("app." + dataTypeNameComplete, baseType.DataTypeName); return baseType; }
public static void ImportResultColumn(IResultColumn srcCol, TableDefinitionRow destTab) { DataTypeDefinitionRow dataType = GetType(srcCol, destTab.Table.DataSet.DataTypeDefinition); FieldDefinitionRow destField = destTab.FindFieldByAliasOrName(srcCol.Name); // destTab.Table.DataSet.FieldDefinition destTabs.FindByTableName(srcTab.Name); if (destField == null) destField = destTab.FindFieldByAliasOrName(srcCol.Alias); if (destField == null) { destField = destTab.AddFieldDefinitionRow(srcCol.Name, dataType.DataTypeName); } else { destField.DataTypeDefinitionRow = dataType; } destField.DBFieldType = "PROC_RETURN"; // destField.ReadOnly = true; //Exception on accessing srcCol.Alias destField.FieldAlias = srcCol.Alias; System.Diagnostics.Debug.WriteLine(string.Format( "FeldName={4}.{3}, DataTypeName={0}, DataTypeNameComplete={1}, DbTargetType={2}" , srcCol.DataTypeName , srcCol.DataTypeNameComplete , srcCol.DbTargetType , srcCol.Name , destTab.TableName)); /* destField.DataType = ???; srcCol.DataType; // int srcCol.DataTypeName; srcCol.DataTypeNameComplete; srcCol.DbTargetType; */ destField.SetDefaultValueNull(); destField.OriginalName = srcCol.Name; /** unsupported properties destField.FieldExpression = srcCol.??? destField.NullValue = srcCol.??? // nullvaluereplacement destField.XmlFieldType = ???; // default is Attribute // srcCol.AllProperties; srcCol.CharacterOctetLength; srcCol.CharacterSetCatalog; srcCol.CharacterSetName; srcCol.CharacterSetSchema; srcCol.CompFlags; srcCol.Flags; srcCol.GlobalProperties; srcCol.DateTimePrecision; // int srcCol.HasDomain; srcCol.Domain; // IDomain srcCol.DomainCatalog; srcCol.DomainName; srcCol.DomainSchema; srcCol.LanguageType; srcCol.LCID; srcCol.NumericPrecision; srcCol.NumericScale; srcCol.Ordinal; srcCol.Properties; srcCol.PropID; srcCol.SortID; srcCol.TDSCollation; srcCol.TypeGuid; srcCol.UserDataXPath; */ }
public void DisplayResultColumnProperties(IResultColumn resultColumn, TreeNode resultColumnNode) { if (this._currentHashCode == resultColumn.GetHashCode()) return; propGrid.SelectedObject = resultColumn; this._currentHashCode = resultColumn.GetHashCode(); }