Bug #14033 Documnetation Error: C# Stored Procedure Call
Submitted: 14 Oct 2005 16:44 Modified: 17 Jul 2006 12:59
Reporter: Fred Nelson Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Documentation Severity:S2 (Serious)
Version:5 OS:Windows (Windows)
Assigned to: MC Brown CPU Architecture:Any

[14 Oct 2005 16:44] Fred Nelson
Description:
The C# example as shown will not work due to a syntax error.

The syntax as shown is:

cmd.Parameters.Add("?fname", "Tom");
cmd.Parameters("?fname").Direction = ParameterDirection.Input;

The correct syntax is:

cmd.Parameters.Add("?fname", "Tom");
cmd.Parameters["?fname"].Direction = ParameterDirection.Input;

Fred

How to repeat:
Statements based on the code as shown will not compile in C#.net.  Making the changed as shown results in a compile and a successful connection to a stored procedure.

Suggested fix:
Correct the documentation.
[16 Oct 2005 7:19] Vasily Kishkin
Could you please say exact name of file or URL ?
[16 Oct 2005 16:16] Fred Nelson
The documentation error is in the last example on this page:

http://dev.mysql.com/doc/refman/5.0/en/connector-net-using-stored.html

(The VB example may be incorrect also.)

Fred
[18 Oct 2005 7:51] Vasily Kishkin
Thanks for bug report. I was not able to build c# example code.
[17 Jul 2006 12:59] MC Brown
This has now been fixed in the C/NET documentation.