This project is read-only.

Problem on Getting Values From Attribute Table of a Shapefile

Aug 3, 2012 at 1:26 AM


I am trying to list attribute table of a shapefile in a Datagridview by using this example.But I am encountering with this error at fs.Open("D:\\work\\test.shp"); line of code.

'DotSpatial.Data.FeatureSet.Open(string)' cannot be accessed with an instance reference; qualify it with a type name instead

Can you please let me know why this is happening?

using System.Windows.Forms;
using DotSpatial.Topology;
using DotSpatial.Data;

 private void btnBuffer_Click(object sender, EventArgs e)
            FeatureSet fs = new FeatureSet();
            DataTable dtOriginal = fs.DataTable;
            for (int row = 0; row < dtOriginal.Rows.Count; row++)
                object[] original = dtOriginal.Rows[row].ItemArray;
Thanks for your time in advance,

Aug 3, 2012 at 4:42 PM

FeatureSet has changed. Now to create a new one from a file you would use:

FeatureSet fs = FeatureSet.Open(filename);
Aug 3, 2012 at 6:07 PM

Thanks Vatvain,

I will test it tomorrow. 

Aug 21, 2012 at 9:10 PM
Edited Aug 21, 2012 at 9:15 PM

Thanks works fine...

FeatureSet fs = FeatureSet.Open(filename);

Dim fs As FeatureSet = FeatureSet.Open(filename)