473,804 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

mydataadapter.f ill

cj
I have a 2003 program that opens a foxpro table via odbc and loads in
the data into a dataset. I copied the code into a 2005 program after a
long wait it fails with the error

ContextSwitchDe adlock was detected
The CLR has been unable to transition from COM context 0x1a3008 to COM
context 0x1a3178 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 CoWaitForMultip leHandles) and routinely pump messages during
long running operations.

I changed my fill statement from myDataAdapter.F ill(ds, tableName) to
myDataAdapter.F ill(ds, 0, 50, tableName) and that works great but I
want all the records.

What's up?
May 15 '07 #1
8 4668
Hi cj,

This is caused by the ContextSwitchDe adlock managed debugging assistant
(MDA) (http://msdn2.microsoft.com/en-us/library/ms172233.aspx), which is a
new feature in VS2005.

The MDA works to detect deadlock with a pre-defined timeout, and it's only
effective when you're running the program under debugger. To turn off this,
plesae add following content to your application configuration file:

<mdaConfig>
<assistants>
<contextSwitchD eadlock enable="false" />
</assistants>
</mdaConfig>
Or you can use following steps to turn off this MDA globally:

1) Open your project in Visual Studio 2005
2) Click on the Debug menu on the main menu of the Visual Studio IDE.
3) Choose the Exceptions option (Debug -Exceptions).
4) The Exceptions window will open.
5) Expand the "Managed Debugging Assistants" node.
6) Uncheck the ContextSwitchDe adlock option under the Thrown column.
7) Click on Ok and close the Exceptions window. You can now run your
application
and test it to see whether the exception occurs again.
Hope this helps.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 16 '07 #2
cj
That worked. It takes quite a bit longer than 2003 however. Both are
running in debugging mode. Maybe 2005 has more code to execute in
debugging mode than 2003. Perhaps I should test that theory.
Walter Wang [MSFT] wrote:
Hi cj,

This is caused by the ContextSwitchDe adlock managed debugging assistant
(MDA) (http://msdn2.microsoft.com/en-us/library/ms172233.aspx), which is a
new feature in VS2005.

The MDA works to detect deadlock with a pre-defined timeout, and it's only
effective when you're running the program under debugger. To turn off this,
plesae add following content to your application configuration file:

<mdaConfig>
<assistants>
<contextSwitchD eadlock enable="false" />
</assistants>
</mdaConfig>
Or you can use following steps to turn off this MDA globally:

1) Open your project in Visual Studio 2005
2) Click on the Debug menu on the main menu of the Visual Studio IDE.
3) Choose the Exceptions option (Debug -Exceptions).
4) The Exceptions window will open.
5) Expand the "Managed Debugging Assistants" node.
6) Uncheck the ContextSwitchDe adlock option under the Thrown column.
7) Click on Ok and close the Exceptions window. You can now run your
application
and test it to see whether the exception occurs again.
Hope this helps.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
May 16 '07 #3
cj
I did some testing. I compiled the program in 2003 and 2005. The 2003
program takes 45 seconds to load the data and the 2005 program takes 1
minute and 40 seconds to load the data. That a whole minute longer!
Why do you reckon this is?
Walter Wang [MSFT] wrote:
Hi cj,

This is caused by the ContextSwitchDe adlock managed debugging assistant
(MDA) (http://msdn2.microsoft.com/en-us/library/ms172233.aspx), which is a
new feature in VS2005.

The MDA works to detect deadlock with a pre-defined timeout, and it's only
effective when you're running the program under debugger. To turn off this,
plesae add following content to your application configuration file:

<mdaConfig>
<assistants>
<contextSwitchD eadlock enable="false" />
</assistants>
</mdaConfig>
Or you can use following steps to turn off this MDA globally:

1) Open your project in Visual Studio 2005
2) Click on the Debug menu on the main menu of the Visual Studio IDE.
3) Choose the Exceptions option (Debug -Exceptions).
4) The Exceptions window will open.
5) Expand the "Managed Debugging Assistants" node.
6) Uncheck the ContextSwitchDe adlock option under the Thrown column.
7) Click on Ok and close the Exceptions window. You can now run your
application
and test it to see whether the exception occurs again.
Hope this helps.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
May 16 '07 #4
cj
Just happened to think. Was the time for loading the records into the
dataset or from dataset to grid? So I tested again timing only the time
it took to load the records into a dataset. 2003 was 42 seconds. 2005
50 seconds. Very consistent over about 3 tries. So it looks like using
the new datagridview

DataGridView1.D ataSource = ds
DataGridView1.D ataMember = tableName

takes much longer than using the old datagrid

DataGrid1.SetDa taBinding(ds, tableName)

DataGridView takes about 55 seconds while datagrid one 3 seconds. Can
anyone comment on this?

cj wrote:
I did some testing. I compiled the program in 2003 and 2005. The 2003
program takes 45 seconds to load the data and the 2005 program takes 1
minute and 40 seconds to load the data. That a whole minute longer! Why
do you reckon this is?
Walter Wang [MSFT] wrote:
>Hi cj,

This is caused by the ContextSwitchDe adlock managed debugging
assistant (MDA)
(http://msdn2.microsoft.com/en-us/library/ms172233.aspx), which is a
new feature in VS2005.
The MDA works to detect deadlock with a pre-defined timeout, and it's
only effective when you're running the program under debugger. To turn
off this, plesae add following content to your application
configuratio n file:

<mdaConfig>
<assistants>
<contextSwitchD eadlock enable="false" />
</assistants>
</mdaConfig>
Or you can use following steps to turn off this MDA globally:

1) Open your project in Visual Studio 2005
2) Click on the Debug menu on the main menu of the Visual Studio IDE.
3) Choose the Exceptions option (Debug -Exceptions).
4) The Exceptions window will open.
5) Expand the "Managed Debugging Assistants" node.
6) Uncheck the ContextSwitchDe adlock option under the Thrown column.
7) Click on Ok and close the Exceptions window. You can now run your
application and test it to see whether the exception occurs again.
Hope this helps.
Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

============== =============== =============== ======
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============== =============== =============== ======

This posting is provided "AS IS" with no warranties, and confers no
rights.
May 16 '07 #5
Hi cj,

This is unfortunately a known issue of DataGridView:

https://connect.microsoft.com/Visual...ck.aspx?Feedba
ckID=117093

<quote>
The big difference between the DataGrid and the DataGridView is that the
DataGrid uses Graphics.DrawSt ring(text, font, brush, textBounds, format)
while the DataGridView uses TextRenderer.Dr awText(graphics , text, font,
textBounds, color, flags). This is where the biggest difference comes from
in my opinion.
</quote>

You can vote on the issue, this will increase the priority of the issue in
our future improvement plan. Thanks.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 17 '07 #6
cj
Well, at least that's an answer. I decided to find out if I could use
the old datagrid in 2005 so I copied my 2003 program to a new dir and
upgraded it to 2005. It kept the datagrid instead of using
datagridview. However performance was 1 minute and 40 seconds on the
upgraded project vs 45 seconds when it was compiled in 2003. So I guess
even if I use the old datagrid in 2005 I will still not get any faster
performance. This sucks. The shame of it all was that 45 seconds was
determined to be too slow so the program was written in Visual FoxPro
instead of 2003. I had hoped 2005 would be faster and able to compete
with FoxPro on this type of app as it occurs here quite often.

I consider myself more of a VB programmer than a FoxPro programmer so
it's humiliating to me to have these problems. I'm not going to get
into a debate about how good VB or Foxpro is. That isn't the point.
The point is I'm disappointed in VB's performance and frankly complexity
too especially in this area. The FoxPro app which turns out a
strikingly similar screen comes up with the data being display in less
than 5 seconds. I can't compete with that using VB! Admittedly it has
the home court advantage as the data is in a stand alone FoxPro table
but all I had to do was put the grid on the form and tell it the
datasource was the table and it was done. I really wish MS would
include in VB the ability to use FoxPro stand alone tables--call it
something else if they wish but that kind of simple functionality. They
own both languages how hard could it be?

Walter Wang [MSFT] wrote:
Hi cj,

This is unfortunately a known issue of DataGridView:

https://connect.microsoft.com/Visual...ck.aspx?Feedba
ckID=117093

<quote>
The big difference between the DataGrid and the DataGridView is that the
DataGrid uses Graphics.DrawSt ring(text, font, brush, textBounds, format)
while the DataGridView uses TextRenderer.Dr awText(graphics , text, font,
textBounds, color, flags). This is where the biggest difference comes from
in my opinion.
</quote>

You can vote on the issue, this will increase the priority of the issue in
our future improvement plan. Thanks.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
May 17 '07 #7
Hi cj,

I understand your concerns about the performance issue regarding
DataGrid/DataGridView in VS2005. Thanks for the feedback. I'll make sure
they're are passed along to product team.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 18 '07 #8
cj
Thanks, and thanks for the help.

Walter Wang [MSFT] wrote:
Hi cj,

I understand your concerns about the performance issue regarding
DataGrid/DataGridView in VS2005. Thanks for the feedback. I'll make sure
they're are passed along to product team.

Regards,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.
May 18 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2478
by: John J. Lee | last post by:
1. Why do I get this in my minibuffer when I do C-c C-c in a python-mode buffer containing the following valid Python code? Wrong type argument: sequencep, cpython ----START #!/usr/bin/env python print "hello, world" ----END
3
2942
by: red floyd | last post by:
I got an error by using std::fill to set an array of pointers to 0. e.g.: class XXX; XXX* v; std::fill(v, v+30, 0); // <-- ERROR -- cant' match template type I have to either explicitly instantiate std::fill<> or cast 0 to XXX*.
6
1623
by: JeffB | last post by:
I have tried several different methods of getting a datagrid to fill with information. Below is the code I'm now using. When viewed in the browser and the text box filled with a parameter value (i.e. CA for Calif), the datagrids header is displayed when the button is clicked, but no data is displayed. I used SQL Profiler and can see that the query comes across with the parameter, and if I take that query string and use it exactly in Query...
2
6087
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for Windows (V5R3). Everything works fine on my development PC, but when I move the application to a Windows Server 2003, it crashes when trying to fill a dataset. I've double-checked that the Win 2k3 server does have Client Access installed, that it...
5
2300
by: moondaddy | last post by:
I have a website where cataloge pages are populated by calling a stored procedure on sql server. I use the sql data adapter's fill method to call this stored procedure and fill the dataset. about 6 to 15 times a day the server hangs and times out when this fill method is called. The SP is simple and uses very little resources (as tested using client statistics in query analyzer). Here's data from my error log which includes the...
2
2109
by: pwh777 | last post by:
I need help in understanding the DataAdapter Fill method and how it relates to the binding to controls on a form. I have a table called tbl_CID_XRef on SQL Server. I have written as a test the simple code below: ---------------------------------------------------------------- Private cob As SqlCommandBuilder Private con As SqlConnection Private cur As CurrencyManager
3
4623
by: Stanav | last post by:
Hello all, I'm developing a web application using VB.Net 2003 and Framework 1.1. This application queries an AS/400 database. I'm using the IBM OleDb provider that came with IBM Client Access for Windows (V5R3). Everything works fine on my development PC, but when I move the application to a Windows Server 2003, it crashes when trying to fill a dataset. I've double-checked that the Win 2k3 server does have Client Access installed, that it...
30
3320
by: Raymond Hettinger | last post by:
Proposal -------- I am gathering data to evaluate a request for an alternate version of itertools.izip() with a None fill-in feature like that for the built-in map() function: >>> map(None, 'abc', '12345') # demonstrate map's None fill-in feature The motivation is to provide a means for looping over all data elements
12
2101
by: Raymond Hettinger | last post by:
I am evaluating a request for an alternate version of itertools.izip() that has a None fill-in feature like the built-in map function: >>> map(None, 'abc', '12345') # demonstrate map's None fill-in feature The movitation is to provide a means for looping over all data elements when the input lengths are unequal. The question of the day is whether that is both a common need and a good approach to real-world problems. The answer to...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.