[mapguide-users] Exception occurred in method MgProxyFeatureReader.GetProperty

Rock Beans rockbeans at gmail.com
Tue Sep 9 15:10:05 EDT 2008


Thanks!

if (featureReader.IsNull("ADDR_NUM"))
{
   STREET_NO = "";
} else {
   STREET_NO = featureReader.GetString("ADDR_NUM");
}

Seems redundant but it works better than try{}catch{} all over the
place. I can see using a variable to to field name making things more
dynamic now that I see this code in some examples. Thanks.


On Tue, Sep 9, 2008 at 2:04 PM, Jack Lee <jack.lee at autodesk.com> wrote:
> Hi,
>
> You should call IsNull to check if the value is not null before calling GetString.
>
>
> -----Original Message-----
> From: mapguide-users-bounces at lists.osgeo.org [mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Rock Beans
> Sent: Tuesday, September 09, 2008 2:57 PM
> To: MapGuide Users Mail List
> Subject: [mapguide-users] Exception occurred in method MgProxyFeatureReader.GetProperty
>
> This error comes up in ASP.NET when random records, I guess contain
> NULL entry. Why does it not just send a empty string? Is there a work
> around for this?
>
> featureReader.GetString("ADDR_NUM")
>
> Value for ADDR_NUM property is null.Value for ADDR_NUM property is
> null. Exception occurred in method MgProxyFeatureReader.GetProperty at
> line 448 in file
> d:\buildforgeprojects\carrera_nightly\build_32.2\ent\os\common\mapguidecommon\Services/ProxyFeatureReader.cpp
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>


More information about the mapguide-users mailing list