<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2 in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588138#M3967</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depends on what you mean by connect I suppose.&amp;nbsp; I put two samples below that should work.&amp;nbsp; Once simply adding the ArcGIS Server layer to a current map view, and another querying against an ArcGIS Server layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Add a new dynamic map service layer.&amp;nbsp; Replace the URL with your desired ArcGIS Server rest URL.&lt;/P&gt;&lt;P&gt;//Use ArcGISTiledMapServiceLayer if it is a tile map service instead.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var layer = new ArcGISDynamicMapServiceLayer(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2FMyServer%2Farcgis%2Frest%2Fservices%2FMyService%2FMapServer" rel="nofollow" target="_blank"&gt;http://MyServer/arcgis/rest/services/MyService/MapServer&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;await layer.InitializeAsync();&lt;/P&gt;&lt;P&gt;//add the layer to the map and zoom to its extent&lt;/P&gt;&lt;P&gt;this.MyMapView.Map.Layers.Add(layer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If by connect you mean you just want to query against the layer, then you'll want to use a QueryTask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;QueryTask myQueryTask = new QueryTask(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2FMyServer%2Farcgis%2Frest%2Fservices%2FMyService%2FMapServer%2F0" rel="nofollow" target="_blank"&gt;http://MyServer/arcgis/rest/services/MyService/MapServer/0&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Query myQuery = new Query("OBJECTID &amp;lt; 100");&lt;/P&gt;&lt;P&gt;OrderByField myOrder = new OrderByField("OBJECTID", SortOrder.Ascending);&lt;/P&gt;&lt;P&gt;myQuery.OrderByFields.Add(myOrder);&lt;/P&gt;&lt;P&gt;myQuery.ReturnGeometry = true;&lt;/P&gt;&lt;P&gt;myQuery.OutFields.Add("OBJECTID");&lt;/P&gt;&lt;P&gt;myQuery.OutFields.Add("GLOBALID");&lt;/P&gt;&lt;P&gt;QueryResult myResult = await myQueryTask.ExecuteAsync(myQuery);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Feb 2016 17:32:37 GMT</pubDate>
    <dc:creator>KrisFoster</dc:creator>
    <dc:date>2016-02-05T17:32:37Z</dc:date>
    <item>
      <title>Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588132#M3961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone can share a source code in C# or VB.Net about how to connect to ArcGIs Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a code that was working in 10.0 but it does not work anymore.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2016 21:28:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588132#M3961</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2016-02-04T21:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588133#M3962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you looking to interface with server through the web or through runtime SDK?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Feb 2016 21:34:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588133#M3962</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2016-02-04T21:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588134#M3963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Runtime SDK.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 01:47:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588134#M3963</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2016-02-05T01:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588135#M3964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you be more specific as to what you're trying to do? For instance, this page - &lt;A href="https://developers.arcgis.com/net/desktop/guide/use-the-mapview-to-display-a-map.htm" title="https://developers.arcgis.com/net/desktop/guide/use-the-mapview-to-display-a-map.htm"&gt;Use a MapView to display a map—ArcGIS Runtime SDK for .NET | ArcGIS for Developers&lt;/A&gt;&amp;nbsp; - describes how to display a map using the runtime SDK. If you notice, there are service URIs for tiled map services and also feature layers, e.g. &lt;SPAN class="hljs-string" style="color: #c41a16; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 12.6438px; background-color: #f8f8f8;"&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver3.arcgisonline.com%2FArcGIS%2Frest%2Fservices%2FEarthquakes%2FEarthquakesFromLastSevenDays%2FMapServer%2F0" rel="nofollow" target="_blank"&gt;http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/EarthquakesFromLastSevenDays/MapServer/0&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #1c00cf; font-family: Consolas, 'Andale Mono', 'Lucida Console', Monaco, 'Courier New', Courier, monospace; font-size: 12.6438px; background-color: #f8f8f8;"&gt;/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's a connection to ArcGIS Server... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 15:48:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588135#M3964</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2016-02-05T15:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588136#M3965</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can't answer your question...but tagging &lt;A href="https://community.esri.com/space/2149"&gt;ArcGIS Runtime SDK for .NET&lt;/A&gt;&amp;nbsp; for more exposure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 15:50:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588136#M3965</guid>
      <dc:creator>RebeccaStrauch__GISP</dc:creator>
      <dc:date>2016-02-05T15:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588137#M3966</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe you have to do it through map services.&amp;nbsp; After searching for a long time I found this&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/net/desktop/guide/supported-geodatabase-formats.htm" title="https://developers.arcgis.com/net/desktop/guide/supported-geodatabase-formats.htm"&gt;Supported geodatabase formats—ArcGIS Runtime SDK for .NET | ArcGIS for Developers&lt;/A&gt; &lt;/P&gt;&lt;P&gt;which says &lt;/P&gt;&lt;P&gt;ArcGIS Runtime for .NET against Enterprise geodatabase -&amp;gt; Supported only if using services&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope someone proves me wrong.&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 16:28:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588137#M3966</guid>
      <dc:creator>ScottMason</dc:creator>
      <dc:date>2016-02-05T16:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588138#M3967</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jose,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depends on what you mean by connect I suppose.&amp;nbsp; I put two samples below that should work.&amp;nbsp; Once simply adding the ArcGIS Server layer to a current map view, and another querying against an ArcGIS Server layer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//Add a new dynamic map service layer.&amp;nbsp; Replace the URL with your desired ArcGIS Server rest URL.&lt;/P&gt;&lt;P&gt;//Use ArcGISTiledMapServiceLayer if it is a tile map service instead.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;var layer = new ArcGISDynamicMapServiceLayer(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2FMyServer%2Farcgis%2Frest%2Fservices%2FMyService%2FMapServer" rel="nofollow" target="_blank"&gt;http://MyServer/arcgis/rest/services/MyService/MapServer&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;await layer.InitializeAsync();&lt;/P&gt;&lt;P&gt;//add the layer to the map and zoom to its extent&lt;/P&gt;&lt;P&gt;this.MyMapView.Map.Layers.Add(layer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If by connect you mean you just want to query against the layer, then you'll want to use a QueryTask.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;QueryTask myQueryTask = new QueryTask(new Uri("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2FMyServer%2Farcgis%2Frest%2Fservices%2FMyService%2FMapServer%2F0" rel="nofollow" target="_blank"&gt;http://MyServer/arcgis/rest/services/MyService/MapServer/0&lt;/A&gt;&lt;SPAN&gt;"));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Query myQuery = new Query("OBJECTID &amp;lt; 100");&lt;/P&gt;&lt;P&gt;OrderByField myOrder = new OrderByField("OBJECTID", SortOrder.Ascending);&lt;/P&gt;&lt;P&gt;myQuery.OrderByFields.Add(myOrder);&lt;/P&gt;&lt;P&gt;myQuery.ReturnGeometry = true;&lt;/P&gt;&lt;P&gt;myQuery.OutFields.Add("OBJECTID");&lt;/P&gt;&lt;P&gt;myQuery.OutFields.Add("GLOBALID");&lt;/P&gt;&lt;P&gt;QueryResult myResult = await myQueryTask.ExecuteAsync(myQuery);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2016 17:32:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588138#M3967</guid>
      <dc:creator>KrisFoster</dc:creator>
      <dc:date>2016-02-05T17:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588139#M3968</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;from 10.0 to 10.1 there was a huge change on how to access ArcGIS Server...&amp;nbsp; Local connections (AGSConnection())&amp;nbsp; are no more... I am sure you have found that out.&lt;/P&gt;&lt;P&gt;As per others questions, it depends on what you are looking for.&lt;/P&gt;&lt;P&gt;It is through the REST/SOAP service API? &lt;/P&gt;&lt;P&gt;Is it to create SOIs or SOEs ? ( Server object interceptors / Server object extensions ) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2016 20:52:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588139#M3968</guid>
      <dc:creator>MichaelRobb</dc:creator>
      <dc:date>2016-02-08T20:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net or C# code to Connect to ArcGIS Server 10.2</title>
      <link>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588140#M3969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just want to re-write this VB.Net code using ArcGIS Server 10.2. It works fine in ArcGIS Server 10.0 but it fails in ArcGIS Server 10.2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Dim gputilities As IGPUtilities = New GPUtilitiesClass()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim myResult As Boolean = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Declare server context variables&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mapServerContext As IServerContext = Nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim agsServerConnection As ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection = Nothing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim featuresCount As Integer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim username As String = ConfigurationManager.AppSettings("username")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim password As String = ConfigurationManager.AppSettings("password")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim domain As String = ConfigurationManager.AppSettings("domain")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim hostname As String = ConfigurationManager.AppSettings("hostname")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mapservice As String = ConfigurationManager.AppSettings("mapservice")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Connect to ArcGIS Server&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim adfIdentity As New ESRI.ArcGIS.ADF.Identity(username, password, domain)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; agsServerConnection = New ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection(hostname, adfIdentity)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; agsServerConnection.Connect()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (Not agsServerConnection.IsConnected) Then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; agsServerConnection.Dispose()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get a reference to the server object manager to use in creating server objects&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim serverObjectManager As ESRI.ArcGIS.Server.IServerObjectManager = agsServerConnection.ServerObjectManager&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create a server context for and get a reference to the BloomfieldTownship map service.&amp;nbsp; We will&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' use this to access map information and query features.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapServerContext = serverObjectManager.CreateServerContext(mapservice, "MapServer")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mapServer As ESRI.ArcGIS.Carto.IMapServer2 = TryCast(mapServerContext.ServerObject, ESRI.ArcGIS.Carto.IMapServer2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get a reference to the map service's server objects &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim mapServerObjects As ESRI.ArcGIS.Carto.IMapServerObjects = CType(mapServer, ESRI.ArcGIS.Carto.IMapServerObjects)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim map As ESRI.ArcGIS.Carto.IMap = mapServerObjects.Map(mapServer.DefaultMapName)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c#" __jive_macro_name="code" class="_jivemacro_uid_14557166312348634 jive_macro_code jive_text_macro" data-renderedposition="743_8_912_0" jivemacro_uid="_14557166312348634"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:46:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/vb-net-or-c-code-to-connect-to-arcgis-server-10-2/m-p/588140#M3969</guid>
      <dc:creator>JoseSanchez</dc:creator>
      <dc:date>2016-02-17T13:46:59Z</dc:date>
    </item>
  </channel>
</rss>

