Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I am using a list view in my project to display some data.

The listview has over 5000 elements to display but when I run my program through debug mode then it gives the following error:
"The CLR has been unable to transition from COM context 0x1a1010 to COM context 0x1a1180 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping"

When I run the exe then it is working fine.

Can any body give me any clue why it is happening ?
Posted
Updated 28-Sep-10 21:44pm
v2
Comments
Toniyo Jackson 27-Sep-10 3:49am    
How u r binding to listview?
souravghosh18 27-Sep-10 4:14am    
using a dataset
Dalek Dave 29-Sep-10 3:44am    
Edited for Grammar and Readability.

1. goto "Debug", "Exceptions..." menu
2. Managed Debugging Assistants, uncheck ContextSwitchDeadlock

Google[^] it for more details.
 
Share this answer
 
you should be building this data in a thread with delegates. the form wont die while you process the data. but I wont go into that here.

a quick fix would be to add Application.doevents somewhere in your looping that adds to the list.

also before the loop starts and after the loop finishes, you should have these lines of code.

Me.ListBox1.BeginUpdate
Me.ListBox1.endUpdate

just some tips of stuff to look into.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900