Hello!
In my application I am executing some sql statements on a different thead.
For that task I have created an ExeCuteSQLCOmmand class.
When pressing run in my mail application the following happens:
void run()
{
executeSQLCommand = new ExecuteSQLCommand(getTextConstants(), null,
getConnection(), getOdbcConnection(), statements);
ThreadStart executeSQLCommandThreadStart = new
ThreadStart(executeSQLCommand.run);
Thread executeSQLCommandThread = new Thread(executeSQLCommandThreadStart);
executeSQLCommandThread.Start();
}
In the ExecuteSQLCommand class i have implementet a cancel method, that
cancels all sql statements from being executed. My problem is when calling
this method from my main application:
executeSQLCommand.cancel();
I get multiple errros saying that some of my objects used to execute sql
statements (OdbcConnection, OdbcCommand, OdbcReader) aren't set to an
instance of an object - but they are??
Do you have any idea what I am doing wrong?
I haven't got great experience in running applications on more than one
tread, any help would really be appreciated.
Thank you very much
Torben
Jon Skeet [C# MVP] - 24 Oct 2004 18:01 GMT
> In my application I am executing some sql statements on a different thead.
> For that task I have created an ExeCuteSQLCOmmand class.
<snip>
Could you post a short but complete program which demonstrates the
problem?
See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Torben Philippsen - 26 Oct 2004 17:00 GMT
Hi Jon!
Thank You for your reply.
Making a short complete program is not easy doable, but I will look into it
and repost.
I appreciate your help.
Best regards Torben
> > In my application I am executing some sql statements on a different thead.
> > For that task I have created an ExeCuteSQLCOmmand class.
[quoted text clipped - 6 lines]
> See http://www.pobox.com/~skeet/csharp/complete.html for details of
> what I mean by that.