Hello all,
I try to use postgresql to show map, but it can't run.
could you tell me where is wrong?
Dim ConnStr As String = "Server=localhost;User Id=postgres; password=password; database=template_postgis;"
Dim all_county As New PostgreSqlFeatureLayer(ConnStr, "twn_county", "gid")
all_county.ZoomLevelSet.ZoomLevel08.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.StandardColors.PaleGreen, GeoColor.StandardColors.Yellow, 3)
all_county.ZoomLevelSet.ZoomLevel08.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
WinformsMap1.MapUnit = GeographyUnit.Meter
Dim worldlayer As New LayerOverlay
worldlayer.Layers.Add(all_county)
WinformsMap1.Overlays.Add(worldlayer)
all_county.Open()
WinformsMap1.CurrentExtent = all_county.GetBoundingBox
all_county.Close()
WinformsMap1.Refresh()
the exception error shows as attachment.
1676-error1.JPG (39.5 KB)