コード例 #1
0
        private void OpenConnection(object obj)
        {
            ConnectionOpenedDelegate res = (ConnectionOpenedDelegate)obj;
            bool   r;
            string erMsg;

            try
            {
                if (cn.State != ConnectionState.Open)
                {
                    cn.Open();
                }
                r     = true;
                erMsg = "";
            }
            catch (Exception ex)
            {
                r     = false;
                erMsg = ex.ToString();
            }
            res(cn, r, erMsg);
        }
コード例 #2
0
 public void DoOpen(ConnectionOpenedDelegate res)
 {
     thr = new Thread(OpenConnection);
     thr.Start(res);
 }