Backgroundworker or easier solution to refresh window messages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?c2lwcHl1Y29ubg==?=

    #1

    Backgroundworker or easier solution to refresh window messages

    I am have a moment where i am having brain freeze :-)

    trying to execute a sql statement that will take awhile but I want to
    process the windows messages and force the user to wait for completion. This
    code works but the first messagebox doesn't repaint and I get a half painted
    window

    Would a backgrounder worker be the best option and how to put in so user
    needs to wait for completion of sql ???

    Thanks


    if (MessageBox.Sho w("Are you sure you want to delete all records ?", "Delete
    Records", MessageBoxButto ns.OKCancel) == DialogResult.OK )
    {
    try
    {
    doCommands();
    cmdQuery.DbExec ute("DELETE FROM " + myTable);
    CloseDB();
    MessageBox.Show ("Success - deleting records ", "Delete
    Records", MessageBoxButto ns.OK);
    }
    catch (Exception ee)
    {
    Logger.WriteExc eption(ee);
    MessageBox.Show ("Failure - deleting records ", "Delete
    Records", MessageBoxButto ns.OK);
    }
Working...