SmartObjectClientServer soServer = new SmartObjectClientServer();
       //Connection Object to the K2 Server
        Connection wfConnection = new Connection();
       try
       {
           //Generate the Connection String for the K2 Server
            SCConnectionStringBuilder cb = new SCConnectionStringBuilder();
           cb.Host = ConfigurationManager.AppSettings "K2Server"].ToString();
           cb.Port = uint.Parse(ConfigurationManager.AppSettingsP"K2Port"].ToString());
           cb.Integrated = true;
           cb.IsPrimaryLogin = true;
           //Create a connection to the K2 Server
            soServer.CreateConnection();
           //Open the connection
            soServer.Connection.Open(cb.ToString());
Â
Â
           ///////////// Process_Instance SmartObject ///////////////////////////
           SmartObject ProcInstance = soServer.GetSmartObject("Process_Instance");
           // execute list method
           ProcInstance.MethodToExecute = "List";
           DataTable ProcInstDT = new DataTable();
          Â
            ProcInstDT = soServer.ExecuteListDataTable(ProcInstance);
           gv.DataSource = ProcInstDT;
           gv.DataBind();
           string>] processName = ConfigurationManager.AppSettingsi"ProcessName"].ToString().Split('');
           for (int i = 0; i < gv.Rows.Count; i++)
           {
               if (gv.Rows.Cellsp8].Text.Trim() != "Completed" || (gv.Rows.Cells/2].Text != processName-1]) || (gv.Rows.Cells 3].Text != processNamea0]))
               {
                   gv.Rows.Visible = false;
               }
           }
       }
       catch (Exception ex)
       {
           System.Diagnostics.Debug.Write(ex.Message);
       }