Click here to Skip to main content
15,885,032 members
Home / Discussions / C#
   

C#

 
PraiseRe: Data type mismatch in criteria expression." in c# Pin
sai.201216-Nov-17 9:56
sai.201216-Nov-17 9:56 
GeneralRe: Data type mismatch in criteria expression." in c# Pin
Eddy Vluggen16-Nov-17 10:33
professionalEddy Vluggen16-Nov-17 10:33 
QuestionLicensing a .NET DLL Pin
P.Gnanaraj16-Nov-17 2:17
P.Gnanaraj16-Nov-17 2:17 
AnswerRe: Licensing a .NET DLL Pin
Richard MacCutchan16-Nov-17 3:20
mveRichard MacCutchan16-Nov-17 3:20 
QuestionAsync method/task issue Pin
primem0ver15-Nov-17 7:21
primem0ver15-Nov-17 7:21 
AnswerRe: Async method/task issue Pin
Sascha Lefèvre15-Nov-17 8:33
professionalSascha Lefèvre15-Nov-17 8:33 
GeneralRe: Async method/task issue Pin
primem0ver15-Nov-17 9:52
primem0ver15-Nov-17 9:52 
GeneralRe: Async method/task issue Pin
Sascha Lefèvre15-Nov-17 10:19
professionalSascha Lefèvre15-Nov-17 10:19 
I think you misunderstood - I didn't want to imply that you shouldn't use tasks (or worker threads in general). For keeping the UI responsive/updating a progress bar while a lengthy operation is in progress it's the only option you have. Just when you do use tasks/threads you have to make sure you don't directly call control's methods but invoke that on the UI thread (which is likely the cause of the TargetInvocationException) - take a look the the link in my previous reply.
And I would recommend to separate the tasks from your custom control classes, but that's a design issue and not the immediate cause of your problem here.

Can you show the stack trace of the exception and the code where it occurs?
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

AnswerRe: Async method/task issue Pin
Gerry Schmitz16-Nov-17 4:24
mveGerry Schmitz16-Nov-17 4:24 
GeneralRe: Async method/task issue Pin
primem0ver16-Nov-17 10:57
primem0ver16-Nov-17 10:57 
GeneralRe: Async method/task issue Pin
Gerry Schmitz16-Nov-17 11:13
mveGerry Schmitz16-Nov-17 11:13 
GeneralRe: Async method/task issue Pin
primem0ver28-Nov-17 13:41
primem0ver28-Nov-17 13:41 
GeneralRe: Async method/task issue Pin
Gerry Schmitz29-Nov-17 4:29
mveGerry Schmitz29-Nov-17 4:29 
GeneralRe: Async method/task issue Pin
primem0ver2-Dec-17 13:30
primem0ver2-Dec-17 13:30 
GeneralRe: Async method/task issue Pin
Gerry Schmitz2-Dec-17 13:46
mveGerry Schmitz2-Dec-17 13:46 
GeneralRe: Async method/task issue Pin
primem0ver3-Dec-17 1:13
primem0ver3-Dec-17 1:13 
GeneralRe: Async method/task issue Pin
primem0ver3-Dec-17 1:46
primem0ver3-Dec-17 1:46 
GeneralRe: Async method/task issue Pin
Gerry Schmitz3-Dec-17 3:17
mveGerry Schmitz3-Dec-17 3:17 
GeneralRe: Async method/task issue Pin
primem0ver3-Dec-17 4:03
primem0ver3-Dec-17 4:03 
GeneralRe: Async method/task issue Pin
Gerry Schmitz3-Dec-17 4:41
mveGerry Schmitz3-Dec-17 4:41 
GeneralRe: Async method/task issue Pin
primem0ver4-Dec-17 2:12
primem0ver4-Dec-17 2:12 
GeneralRe: Async method/task issue Pin
Gerry Schmitz4-Dec-17 6:50
mveGerry Schmitz4-Dec-17 6:50 
GeneralRe: Async method/task issue Pin
primem0ver3-Feb-18 23:03
primem0ver3-Feb-18 23:03 
GeneralRe: Async method/task issue Pin
Gerry Schmitz4-Feb-18 7:05
mveGerry Schmitz4-Feb-18 7:05 
Questionin c# school management project Pin
Member 1289859014-Nov-17 19:51
Member 1289859014-Nov-17 19:51 

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.