コード例 #1
0
        public static AsyncConnectionResult TryToOpenConnection(SqlConnection conn, ref string error)
        {
            if (conn == null)
            {
                throw new Exception("Connection instance is null!");
            }

            frmAsyncConnectionOpener frm = new frmAsyncConnectionOpener();

            frm._cp   = null;
            frm._conn = conn;
            frm.BringToFront();
            frm.ShowDialog();
            error = frm._lastError;
            return(frm._result);
        }
コード例 #2
0
        public static AsyncConnectionResult TryToOpenConnection(ConnectionParams cp, ref string error)
        {
            if (cp == null)
            {
                throw new Exception("Connection parameters instance is null!");
            }

            frmAsyncConnectionOpener frm = new frmAsyncConnectionOpener();

            frm._cp   = cp.CreateCopy();
            frm._conn = null;
            frm.BringToFront();
            frm.ShowDialog();
            error = frm._lastError;
            return(frm._result);
        }