Updating row with Sharpmap 2.0; Should this work?

May 5, 2009 at 7:49 PM
ShapeFileProvider sf = null;

sf = new ShapeFileProvider(filePath);
if (!sf.IsOpen)
    sf.Open(false);

FeatureDataSet ds = new FeatureDataSet();
BoundingBox bbox = sf.GetExtents();

sf.ExecuteIntersectionQuery(bbox, ds);

DataTable table = ds.Tables[0];

for (int i = 0; i < table.Rows.Count; i++)
{
    DataRow dr = table.Rows[i];
    for (int j = 0; j < table.Columns.Count; j++)
    {
        DataColumn dc = table.Columns[j];
        if(dr[j].ToString() == "Syracuse")
        {
            dr[j] = "Syracusa";  // I place a break here assuming that it will only occur once.  But it keeps breaking.
            dr.AcceptChanges();
        }
    }
}


Coordinator
May 6, 2009 at 10:28 AM
Hi poepoe12002, unfortunately this is not v2 code and will not update the shapefile. The real v2 is from http://sharpmapv2.googlecode.com . We were trying to import the code back into codeplex a while ago while maintaining the version history but hit issues so the v2 code here is very very old. hth jd
May 6, 2009 at 4:58 PM
Thanks, John.

Am I using the V2 Beta? 

I went to the googlecode site and could not figure out how to get the code. 
I tried to use subversion: http://sharpmapv2.googlecode.com/svn/trunk/ sharpmapv2-read-only
Said it dosent exist.  Direction would be appreciated.
May 6, 2009 at 5:03 PM
I stand corrected.  I am downloading it as I write. 

Re: V2 vs V2 Beta.  Are the changes describes anywhere?
Coordinator
May 6, 2009 at 5:04 PM
Edited May 6, 2009 at 5:07 PM
Hi poepoe12002,
have a look at this Wiki page.
This only helps with getting source though, which you already solved :-).

Hth
FObermaier
Coordinator
May 6, 2009 at 5:08 PM
hi poepoe12002 remove the 'sharpmapv2-readonly' part. it should be just http://sharpmapv2.googlecode.com/svn/trunk/ hth jd