Click here to Skip to main content
12,817,428 members (33,096 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# 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 12:44pm
jibesh 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 ?
thursunamy 27-Dec-12 9:02am
You can review
Yaseer Arafat 27-Dec-12 12:15pm
Error Occurred in Db.SubmitChanges();
DB is a DBML files datacontext variable

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

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170308.1 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2017
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