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

Jackie C. Ng jumpinjackie at gmail.com
Wed Sep 10 05:35:21 EDT 2008


There is a reason for this redundancy. GetXXX methods throw an exception on
null values, so IsNull() is used to determine if GetXXX is callable or not.

See: http://www.nabble.com/Exception-thrown-on-null-values--to15746442.html

- Jackie


Rock Beans wrote:
> 
> 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
>>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 


-----
http://themapguyde.blogspot.com

http://www.linkedin.com/in/jackieng
-- 
View this message in context: http://www.nabble.com/Exception-occurred-in-method-MgProxyFeatureReader.GetProperty-tp19398912p19409916.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list