Question
· Mar 26, 2018

Integration with cache database

We have an application made in asp.net and want to make a integration for our client who is using cache database. So can any one suggest how to communicate with the database as we are new to this system.

Discussion (6)0
Log in or sign up to continue

Add the reference to cache provider for .net

using InterSystems.Data.CacheClient;


CacheDataReader dr;

using (CacheConnection con = new CacheConnection())
   {
             con.ConnectionString = "Server=" + Servername+ ";" + "Port=1972; Namespace=Namespace;" + "Password=" + Password + ";" + "User ID=" + UserName + ";";

             CacheCommand cmd;
             cmd = new CacheCommand("select * from table", con);
              con.SetQueryRuntimeMode(InterSystems.Data.CacheTypes.QueryRuntimeMode.DISPLAY);
              con.Open();
              dr = cmd.ExecuteReader();
             while (dr.Read()){ // do your stuff }
}