Bug #51882 Stored Procedures shut MS Visual Studio using strongly typed DataSets
Submitted: 9 Mar 2010 18:23 Modified: 10 Mar 2010 14:02
Reporter: Roberto Silva Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:6.2.2 OS:Windows (XP and Visual Studio 2008)
Assigned to: CPU Architecture:Any
Tags: C#, connector, dataset, stored procedures, Visual Studio

[9 Mar 2010 18:23] Roberto Silva
Description:
I was having trouble viewing the stored procedures that my user had permission to execute.

After finding out the 'Use Procedure Bodies' option had to be se to false on the connection I tried adding a stored procedure to a strongly typed dataset and that's when the problem occurs.

Dragging the stored procedure to the dataset doesn't work.
Adding the stored procedure to a tableDataAdapter shuts Visual Studio instantly.

Using SQL Server, by dragging the stored procedure it would automatically create a dataTable and dataTableAdapter for it. Adding it to an existing tableDataAdapter would create a new method for that adapter.

How to repeat:
1.) Create a new Blank Project

2.) Add a new Item to the project, type being DataSet.xsd

3.) Add a new connection through the server explorer to your Data Connections, enter your mysql database and server details, don't forget to set Use Procedure Bodies=False on the advanced settings.

4.) Create a procedure if your database doesn't have any

5.) Open the dataset created on step 2.

ERROR 1: 
 5.) Dragging stored procedures to the opened dataset does not work.

ERROR 2:
 6.) drag a table to the dataset, if asked about storing connection string unsafely accept it.
    A new DataTable and TableAdapter will be created.

 7.) Right click the TableAdapter that was automatically created, select Add Query
 8.) Select 'Use Existing Stored Procedure' and press Next
 9.) Select any existing stored procedure

        AND VOILA. Visual Studio shuts.

Suggested fix:
-
[9 Mar 2010 18:31] Roberto Silva
Ok, I realized I was trying to add the stored procedure to a VIEW in the dataset instead of adding it to a TABLE in the dataset.
The bug remains the same tho
[10 Mar 2010 8:52] Tonci Grgin
Hi Roberto.

This is a duplicate of Bug#50671 (and many more if I may say so).
[10 Mar 2010 13:50] Roberto Silva
oh.. and i thoght i was bringing news to the world!!
hehe
[10 Mar 2010 13:53] Tonci Grgin
:-)
[10 Mar 2010 14:02] Roberto Silva
I have also realized this only happens when i connect to the database with users that don't have permissions to alter/create/delete routines.
When I connect with the user that created those stored procedures it works just fine. 
Except for dragging the stored procedures to the dataset designer
[11 Mar 2010 18:25] Reggie Burnett
This is not something we can fix when using mysql 5.1 and earlier.  The reason is that if a user only has execute perms on it then there is no way we can see the parameters for the routine.  We can execute the procedure only by "trusting" the number and order of parameters given by the user.  Future versions of MySQL will have a information_schema parameters view and this scenario should work with that.