コード例 #1
0
 // GET: Project
 public ActionResult Index()
 {
     try
     {
         var data = pCl.ReadAll();
         pCl.Close();
         return(View(data));
     }
     catch (Exception)
     {
         pCl.Abort();
         return(View("NoResponseFromServer"));
         //return new HttpStatusCodeResult(404, "Item Not Found");
     }
 }
コード例 #2
0
        public static void CloseAllConnection()
        {
            if (serviceClient != null)
            {
                serviceClient.Close();

                serviceClient = null;
            }

            if (serviceHost != null)
            {
                serviceHost.Close();

                serviceHost = null;
            }
        }