public AddColumn ( string fieldName, |
||
fieldName | string | A filed name |
dataType | A CLR data type | |
return | void |
/// <summary> /// Generates a dBase file header. /// </summary> /// <param name="dbFields">An array containing the dBase filed descriptors</param> /// <param name="count">The record count</param> /// <returns>A stub of dBase file header</returns> public static DbaseFileHeader GetDbaseHeader(DbaseFieldDescriptor[] dbFields, int count) { DbaseFileHeader header = new DbaseFileHeader(); header.NumRecords = count; foreach (DbaseFieldDescriptor dbField in dbFields) { header.AddColumn(dbField.Name, dbField.DbaseType, dbField.DataType, dbField.Length, dbField.DecimalCount); } return(header); }
/// <summary> /// Gets a stub of dBase file header /// </summary> /// <param name="feature">The feature</param> /// <param name="count">The record count</param> /// <param name="attributeNames">A list containing the attribute names</param> /// <returns>A stub of dBase file header</returns> public static DbaseFileHeader GetDbaseHeader(Feature feature, List <string> attributeNames, int count) { //string[] names = feature.Layer.FeatureAttributeNames.ToArray();// attribs.GetNames(); string[] names = attributeNames.ToArray();// attribs.GetNames(); DbaseFileHeader header = new DbaseFileHeader(); header.NumRecords = count; int i = 0; foreach (string name in names) { Type type = feature.Attributes[i].GetType();// attribs.GetType(name); header.AddColumn(name, type); i++; } header.Encoding = System.Text.ASCIIEncoding.ASCII; return(header); }
/// <summary> /// Generates a dBase file header. /// </summary> /// <param name="dbFields">An array containing the dBase filed descriptors</param> /// <param name="count">The record count</param> /// <returns>A stub of dBase file header</returns> public static DbaseFileHeader GetDbaseHeader(DbaseFieldDescriptor[] dbFields, int count) { DbaseFileHeader header = new DbaseFileHeader(); header.NumRecords = count; foreach (DbaseFieldDescriptor dbField in dbFields) header.AddColumn(dbField.Name, dbField.DbaseType, dbField.DataType, dbField.Length, dbField.DecimalCount); return header; }
/// <summary> /// Gets a stub of dBase file header /// </summary> /// <param name="feature">The feature</param> /// <param name="count">The record count</param> /// <param name="attributeNames">A list containing the attribute names</param> /// <returns>A stub of dBase file header</returns> public static DbaseFileHeader GetDbaseHeader(Feature feature, List<string> attributeNames, int count) { //string[] names = feature.Layer.FeatureAttributeNames.ToArray();// attribs.GetNames(); string[] names = attributeNames.ToArray();// attribs.GetNames(); DbaseFileHeader header = new DbaseFileHeader(); header.NumRecords = count; int i = 0; foreach (string name in names) { Type type = feature.Attributes[i].GetType();// attribs.GetType(name); header.AddColumn(name, type); i++; } header.Encoding = System.Text.ASCIIEncoding.ASCII; return header; }