title: Exception has been thrown by the target of an invocation(SQLServer spatial 2008 R2)
body: <p>I am getting the following error when i try to read the geography data from SQLServer spatial 2008 R2 as i am trying to display geography features on aspx page using Dot Spatiakl.Please do the needful to solve this issue.</p>
  
  <pre><code>System.Reflection.TargetInvocationException was unhandled by user code
    Message=Exception has been thrown by the target of an invocation.
    Source=mscorlib
    StackTrace:
         at System.RuntimeMethodHandle._SerializationInvoke(IRuntimeMethodInfo method, Object target, SignatureStruct&amp; declaringTypeSig, SerializationInfo info, StreamingContext context)
         at System.Runtime.Serialization.ObjectManager.CompleteISerializableObject(Object obj, SerializationInfo info, StreamingContext context)
         at System.Runtime.Serialization.ObjectManager.FixupSpecialObject(ObjectHolder holder)
         at System.Runtime.Serialization.ObjectManager.DoFixups()
         at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
         at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
         at System.Resources.ResourceReader.DeserializeObject(Int32 typeIndex)
         at System.Resources.ResourceReader._LoadObjectV2(Int32 pos, ResourceTypeCode&amp; typeCode)
         at System.Resources.ResourceReader.LoadObjectV2(Int32 pos, ResourceTypeCode&amp; typeCode)
         at System.Resources.ResourceReader.LoadObject(Int32 pos, ResourceTypeCode&amp; typeCode)
         at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase, Boolean isString)
         at System.Resources.RuntimeResourceSet.GetObject(String key, Boolean ignoreCase)
         at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture, Boolean wrapUnmanagedMemStream)
         at System.Resources.ResourceManager.GetObject(String name, CultureInfo culture)
  
  
         at DotSpatial.Symbology.SymbologyImages.get_select() in D:\Arun Working\Dot Spatial\dotspatial-66654\DotSpatial.Symbology\SymbologyImages.Designer.cs:line 121
         at DotSpatial.Symbology.FeatureLayer.Configure(IFeatureSet featureSet) in D:\Arun Working\Dot Spatial\dotspatial-66654\DotSpatial.Symbology\FeatureLayer.cs:line 249
         at DotSpatial.Symbology.FeatureLayer..ctor(IFeatureSet featureSet) in D:\Arun Working\Dot Spatial\dotspatial-66654\DotSpatial.Symbology\FeatureLayer.cs:line 148
         at DotSpatial.Symbology.PolygonLayer..ctor(IFeatureSet inFeatureSet) in D:\Arun Working\Dot Spatial\dotspatial-66654\DotSpatial.Symbology\PolygonLayer.cs:line 44
         at DotSpatial.Controls.MapPolygonLayer..ctor(IFeatureSet inFeatureSet) in D:\Arun Working\Dot Spatial\dotspatial-66654\DotSpatial.Controls\MapPolygonLayer.cs:line 84
         at DotSpatial.Controls.MapLayerCollection.Add(IFeatureSet featureSet) in D:\Arun Working\Dot Spatial\dotspatial-66654\DotSpatial.Controls\MapLayerCollection.cs:line 205
         at DotSpatial.WebControls.GDIMap.AddLayer1(FeatureSet sqlpoly) in D:\Arun Working\Dot Spatial\dotspatial-66654\DotSpatial.WebControls\GDIMap.cs:line 164
         at DotSpatial.WebControls.WebMap.AddLayer1(FeatureSet sqlpoly) in D:\Arun Working\Dot Spatial\dotspatial-66654\DotSpatial.WebControls\WebMap.cs:line 399
         at Element_DotSpatial.MapReport.DrawTheGeography(SqlGeography geog, String myLayerName, String myItemLegend, Color fillColour, Color outlineColour, Double lineWidth, Boolean zoomTo) in D:\Arun Working\Projects\Element_DotSpatial\Element_DotSpatial\MapReport.aspx.cs:line 216
         at Element_DotSpatial.MapReport.CreateMap() in D:\Arun Working\Projects\Element_DotSpatial\Element_DotSpatial\MapReport.aspx.cs:line 56
         at Element_DotSpatial.MapReport.Page_Load(Object sender, EventArgs e) in D:\Arun Working\Projects\Element_DotSpatial\Element_DotSpatial\MapReport.aspx.cs:line 29
         at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
         at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
         at System.Web.UI.Control.OnLoad(EventArgs e)
         at System.Web.UI.Control.LoadRecursive()
         at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    InnerException: System.ComponentModel.Win32Exception
         Message=The operation completed successfully
         Source=System.Drawing
         ErrorCode=-2147467259
         NativeErrorCode=0
         StackTrace:
              at System.Drawing.Icon.Initialize(Int32 width, Int32 height)
              at System.Drawing.Icon..ctor(SerializationInfo info, StreamingContext context)
         InnerException: 
  </code></pre>
  
  <p>Regards
  Arun Mohan</p>