private void AsyncDalStart() { if (!initilaized || !sqlOK) { return; } try { if (dalAsync == null) { dalAsync = new Data.SqlClient.DalAsync(DalBase);// DalAsync(); dalAsync.AsyncCompleted += new EventHandler(Async_AsyncComplited); } dalAsync.AsyncExecuteBegin(new AsyncCallback(AsyncHandleCallback), "SELECT * FROM " + sqlItems, null, 0, 0); } catch (Exception ex) { MsgBox.ShowError(ex.Message); initilaized = false; } }
private void AsyncDalReStart() { if (!initilaized || !sqlOK) { return; } try { if (dalAsync != null) { dalAsync.AsyncCompleted -= new EventHandler(Async_AsyncComplited); dalAsync.Dispose(); dalAsync = null; } dalAsync = new Data.SqlClient.DalAsync(DalBase);// DalAsync(); dalAsync.AsyncCompleted += new EventHandler(Async_AsyncComplited); } catch (Exception ex) { MsgBox.ShowError(ex.Message); initilaized = false; } }