IGISServerConnection2

563
0
11-07-2011 09:11 AM
AngelParjus
New Contributor
Does anyone have sample code on using  IGISServerConnection2  ? connection.Connect2(userInfo,server);

The code I have throws AccessViolationException {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}   when initiation of serverObjectManager get executed.


          //Bind to product runtime
            ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
           
            String userName = @"domain\userid";
            String roles = "agsadmin";
            String userInfo = userName + ";" + roles;
            String server = "servername";

            //Init Connection
            IGISServerConnection2 connection = new GISServerConnectionClass();
            connection.Connect2(userInfo,server);

            IServerObjectManager serverObjectManager = connection.ServerObjectManager;

Thanks!
0 Kudos
0 Replies