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); }
public void DoOpen(ConnectionOpenedDelegate res) { thr = new Thread(OpenConnection); thr.Start(res); }