DataColumn width and precision

Sep 30, 2011 at 1:52 PM

I am looking for help to define datacolumn width for string data and precision for double values. Here is what I have but it does not works as I expect:

    FeatureSet fs = new FeatureSet(FeatureType.Point); 
    // Create a DataColumn and set various properties.
    DataColumn col = new DataColumn();
    col.DataType = typeof(string);
    col.ColumnName = "HND";
 // col.MaxLength = 8;              ?????
 // col.Width = 8;       >>>> for  typeof(string);      ?????
 // col.Precision     >>>> for  typeof(double);      ?????


        DotSpatial.Topology.Point p = new DotSpatial.Topology.Point();
        p.X = 100;
        p.Y = 200;   
        Feature f = new Feature(p);

        f.DataRow["HND"] = "CAR"; 

Thanks for help, vzavec

Sep 30, 2011 at 9:06 PM

The DataTable and DataColumn class have no awareness of precision.

As far as I know the current representation (implementation) ignores this issue. Some databases, for example, do support precision and width, so DataProvider may need some adjustments.