Question
· Jan 9, 2020

Best way to programatically determine if you are running Cache or IRIS

Any recommendations - From COS, From .net?

Discussion (2)1
Log in or sign up to continue

Hi,

In .Net, using the managed provider (https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GBMP) the connection object has the property ServerZV, that returns the $ZV:

        static void Main(string[] args)
        {
            InterSystems.Data.CacheClient.CacheConnection cacheConn = new InterSystems.Data.CacheClient.CacheConnection();
            cacheConn.ConnectionString = "Server=localhost;Port=1972; Namespace=USER; Password=xxxx; User ID=xxxx";
            cacheConn.Open();

            Console.WriteLine(cacheConn.ServerZV);
            Console.ReadLine();

            cacheConn.Close();
            cacheConn.Dispose();

         }