Click here to Skip to main content
15,915,703 members
Home / Discussions / C#
   

C#

 
AnswerRe: insert date to the data base Pin
SeMartens12-Jan-09 4:29
SeMartens12-Jan-09 4:29 
GeneralRe: insert date to the data base Pin
abu rakan12-Jan-09 10:25
abu rakan12-Jan-09 10:25 
GeneralRe: insert date to the data base Pin
SeMartens12-Jan-09 20:58
SeMartens12-Jan-09 20:58 
AnswerRe: insert date to the data base Pin
Wendelius12-Jan-09 12:07
mentorWendelius12-Jan-09 12:07 
Question[Message Deleted] Pin
JGroen12-Jan-09 4:20
JGroen12-Jan-09 4:20 
AnswerRe: INotifyPropertyChanged with user controls Pin
Not Active12-Jan-09 4:44
mentorNot Active12-Jan-09 4:44 
AnswerRe: INotifyPropertyChanged with user controls Pin
Moim Hossain12-Jan-09 4:48
Moim Hossain12-Jan-09 4:48 
QuestionHow to abort filling a dataset? Pin
kasatch12-Jan-09 4:03
kasatch12-Jan-09 4:03 
Hi,

This is my first message to this forum, so sorry for any mistakes.

I have created a worker thread which is filling a dataset. The thread action is as follows:
// The thread procedure performs fillinfg dataset
    public void fillDataSet()
    {
            ds.Clear();
            ds.Tables.Clear();

            System.Data.OracleClient.OracleDataAdapter myAdapter = new System.Data.OracleClient.OracleDataAdapter(cmd);

            try
            {
                myAdapter.Fill(ds);
                return;
            }
            catch (ThreadAbortException)
            {
                return;
            }
            catch (System.Data.OracleClient.OracleException oe)
            {
                MessageBox.Show(oe.Message, "Oracle error");
                return;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Application error");
                return;
            }
    }


From the main thread, by clicking a button, i'm trying to abort the worker thread:

private void buttonAdv1_Click(object sender, EventArgs e)
{
    t.Abort();
           
    while (true)
    {
        if (!t.IsAlive)
        {
            MessageBox.Show("The script was cancelled by the user", "Script cancelled");
            break;
        }
    }
    this.Close();
}


The problem is that t.Abort() waits till the end of filling a dataset. The problem is when filling dataset takes an hour, then user have to wait this hour for any effects of cancelling.

Do you have any ideas how can you cancell filling a dataset immediately?

Thanks for any responses,
Kasatch
AnswerRe: How to abort filling a dataset? Pin
benjymous12-Jan-09 4:09
benjymous12-Jan-09 4:09 
AnswerRe: How to abort filling a dataset? Pin
Wendelius12-Jan-09 9:38
mentorWendelius12-Jan-09 9:38 
Questionproblem with timer_tick Pin
prasadbuddhika12-Jan-09 1:04
prasadbuddhika12-Jan-09 1:04 
AnswerRe: problem with timer_tick Pin
Not Active12-Jan-09 1:11
mentorNot Active12-Jan-09 1:11 
GeneralRe: problem with timer_tick Pin
EliottA12-Jan-09 1:17
EliottA12-Jan-09 1:17 
AnswerRe: problem with timer_tick Pin
musefan12-Jan-09 1:41
musefan12-Jan-09 1:41 
GeneralRe: problem with timer_tick Pin
Dave Kreskowiak12-Jan-09 2:15
mveDave Kreskowiak12-Jan-09 2:15 
GeneralRe: problem with timer_tick Pin
musefan12-Jan-09 2:23
musefan12-Jan-09 2:23 
GeneralRe: problem with timer_tick Pin
#realJSOP12-Jan-09 9:31
professional#realJSOP12-Jan-09 9:31 
GeneralRe: problem with timer_tick Pin
musefan12-Jan-09 21:55
musefan12-Jan-09 21:55 
AnswerRe: problem with timer_tick Pin
#realJSOP12-Jan-09 6:03
professional#realJSOP12-Jan-09 6:03 
GeneralRe: problem with timer_tick Pin
prasadbuddhika12-Jan-09 15:49
prasadbuddhika12-Jan-09 15:49 
JokeRe: problem with timer_tick Pin
musefan12-Jan-09 21:53
musefan12-Jan-09 21:53 
QuestionWhat's wrong with this dataset? Pin
ndroo88212-Jan-09 0:20
ndroo88212-Jan-09 0:20 
AnswerRe: What's wrong with this dataset? Pin
Not Active12-Jan-09 0:32
mentorNot Active12-Jan-09 0:32 
GeneralRe: What's wrong with this dataset? Pin
ndroo88212-Jan-09 0:57
ndroo88212-Jan-09 0:57 
GeneralRe: What's wrong with this dataset? Pin
Not Active12-Jan-09 1:10
mentorNot Active12-Jan-09 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.