Bug #38047 Fatal Exception when attempting to use Query Builder with VS 2008
Submitted: 11 Jul 2008 14:32 Modified: 20 Jul 2009 9:20
Reporter: Nolan Bailey Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:5.2.2 OS:Windows
Assigned to: CPU Architecture:Any
Tags: read write protected memory corrupt. 2008 3.5 Framework ASP.NET

[11 Jul 2008 14:32] Nolan Bailey
Description:
Using .NET 3.5 Framework, .NET connector 5.2.2, Visual Studio 2008, MySQL 5.0.51b, and C# language.

The Visual Studio 2008 Query Builder will throw a fatal exception when attempting to build queries against MySQL. 

If one closes the VS 2008 IDE and re-opens the IDE, the bug goes away until you add another query in a DataSet and compile/run the ASP.NET application.

I have noticed that I have to compile and execute the ASP.NET application at least once before this fatal exception happens routinely. 

Once the fatal error starts to happen, one can not use the VS 2008 Query Builder with MySQL again unless the IDE is closed and reopened. 

How to repeat:

To reproduce...

Create a new ASP.NET web application target 3.5 Framework

Have MySQL .NET connector 5.2.2 installed

Add a DataSet to your new project.

Add a table adapter to your DataSet.

Add a query to your table adapter.  Add a few tables for your query with parameters for input.

Build and execute your ASP.NET application.

Add another query to your table adapter in your dataset.  Add a few tables for your query with parameters for input.

The following error will start to happen routinely (after the application has been compiled and executed a few times)...  

VS Query Builder ERROR / Exception:

The query builder failed.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Once the fatal error starts to happen, one can not use the VS 2008 Query Builder again with MySQL unless the IDE is closed and reopened. 

Suggested fix:
It appears that MySQL is not an option with VS 2008 and 3.5 Framework until this bug is addressed.
[26 Jul 2008 2:03] Nolan Bailey
I notice that if the query builder error starts to happen... if you completely erase the query in the query builder, click OK to save (empty text)... then go back into the empty query with the query builder, the error will not happen.   

However, once building a few queries, the error will start again.
[26 Jul 2008 2:06] Nolan Bailey
Also, the error seems to happen more frequently when parameters are used in the query.
[14 Dec 2008 2:44] Öncel Umut TÜRER
I am using VS2008, CSharp and .Net framework 2.0.
For my case all my simple queries works perfect with query builder. However, the ones with more than 5 parameter causes memory read or write error. And after the error, query builder still works for other simple queries.

Question:
I wrote my query without using query builder (also configured parameters by clicking "view code" option in query right click drop down menu). However, when I execute the query it throws this exception.

"Exception Details: System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. Parameter name: length"

I checked my query and parameter in "mysql query browser" and worked fine.
Do you think this exception is thrown because of the initial memory read or write error?

Thanks in advance..
[20 Jun 2009 9:20] Tonci Grgin
Nolan, have you tried newer versions of c/NET? I can not repeat this with c/NET 6.0.4, .NET 3.5 and VS2008Pro.
[20 Jun 2009 9:21] Tonci Grgin
-

Attachment: bug-38047-cNET604.jpg (image/jpeg, text), 38.99 KiB.

[20 Jul 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[14 Feb 2010 10:51] alon zori
i have the same problem, i found a shity solution.
open anew project use the same connection and db and add tableAddapter.
now go to your original project and it will work fine for 1 or 2 times.