Skip to content

TableSingleCS

sindizzy edited this page Dec 30, 2020 · 4 revisions

Sample code that demonstrates how to get the value of a single cell in an attribute table.

using DotSpatial.Data;

 private void btnBuffer_Click(object sender, EventArgs e)
 {
     IFeatureSet fs = FeatureSet.Open(@"C:\[Your File Path\Municipalities.shp");
     fs.FillAttributes();          
     DataTable dt = fs.DataTable;
     for (int row = 0; row < dt.Rows.Count; row++)
     {
         object val = dtOriginal.Rows[row](row)["NAME"](_NAME_);
     }
 }
Clone this wiki locally