I am connecting to an intersystems cache database via C# and I need to obtain a list of all available namespaces.
I am using code like this:
// Source - https://stackoverflow.com/q/79393836
// Posted by Tony Valenti, modified by community. See post 'Timeline' for change history
// Retrieved 2026-04-21, License - CC BY-SA 4.0
namespace ConsoleApp13
{
internal class Program
{
static void Main(string[] args)
{
var CS = "Server=XXXXX;User=system;Password=sys;";
var C = new InterSystems.Data.CacheClient.CacheConnection(CS);
C.Open();
var Command = C.CreateCommand();
Command.CommandText = $@"
select * from %SYS.Namespace_List()
";
var Values = Command.ExecuteReader();
while (Values.Read()) {
}
}
}
}
.jpg)








