Click here to Skip to main content
11,714,345 members (81,957 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: Windows C#4.0
btnChangeImage.Click += (s, e) => {
               //var t = new Thread((ThreadStart)(() =>
                   using (OpenFileDialog fd = new OpenFileDialog())
                       fd.Title = "Select an Image of your";
                       if (fd.ShowDialog() == DialogResult.OK)
                           pbStaffmage.Image = PersonImage = Image.FromFile(fd.FileName);
                   PERSON_IMAGE pI = new PERSON_IMAGE();
                   pI.PERSONS_IMAGE = imageToByteArray(PersonImage);
                   pI.PERSON_ID = _Person.ID;
                   // _Person.PERSON_IMAGE.PERSON_ID

           //    }));

           //    t.SetApartmentState(ApartmentState.STA);
           //    t.Start();
           //    t.Join();

This error Occured

The CLR has been unable to transition from COM context 0x2210c40 to COM context 0x2210e90 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.

How to solve this error?
Posted 26-Dec-12 11:44am
jibesh at 26-Dec-12 21:41pm
can you providen some more details about the code. we have no clue about the data type of the variable DB and has any C++ wrapper gets called in the execution flow? on executing which line you are getting this exception? what are you trying to achieve ?
Yaseer Arafat at 27-Dec-12 12:15pm
Error Occurred in Db.SubmitChanges();
DB is a DBML files datacontext variable
thursunamy at 27-Dec-12 9:02am
You can review

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 540
1 Maciej Los 259
2 Richard MacCutchan 230
3 OriginalGriff 140
4 F-ES Sitecore 140
0 Sergey Alexandrovich Kryukov 545
1 CHill60 375
2 Maciej Los 324
3 Richard MacCutchan 310
4 OriginalGriff 260

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100