[mapguide-users] cannot insert feature,give a favor

Kenneth, GEOGRAF A/S ks at geograf.dk
Mon Sep 17 02:47:48 EDT 2007


I belive that the reader.ToString() returns "MgByteReader", and does not 
return the contents of the reader.
You must read the contents manually. I have replied to this particular 
problem before, so search the list for a
solution on how to do that.

Regards, Kenneth, GEOGRAF A/S



knife skrev:
> private void set_ResourceWriteAble(MgResourceIdentifier resoureId,
> MgResourceService resourceService)
>     {
>        
> //-----------------------------------------------------------------------------
>         String buffer;
>         MgByteReader reader = resourceService.GetResourceContent(resoureId);
>         buffer = reader.ToString();
>         if (buffer.Contains("<Value>TRUE</Value>"))
>         {
>             buffer = buffer.Replace("<Value>TRUE</Value>",
> "<Value>FALSE</Value>");
>             Byte[] buf_Byte = System.Text.Encoding.Default.GetBytes(buffer);
>             MgByteSource byteSource = new MgByteSource(buf_Byte,
> buf_Byte.Length);
>
>             resourceService.SetResource(resoureId, byteSource.GetReader(),
> null);
>         }
>         
>        
> //-----------------------------------------------------------------------------
>
>     }
>
>   


More information about the mapguide-users mailing list