ERROR [HY000] [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.13-log]Incorrect number of arguments for PROCEDURE election phone book.GetPersonAndLock; expected 1, got 0
Any advice?
P.S. By unknown reason the "Stored Procedure" radio button of the source configuration wizard is disabled. Data source configuration was edited manually.
I've tried that initially. In that case I get another error:
ERROR [42000] [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.13-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GetPersonAndLock' at line 1
The stored procedure itself works correctly, I've tested it using MySQL Workbench.
Also, another stored procedure which does not have parameters works correctly when invoked from asp.net using the same connection string.
ERROR [42000] [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.13-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GetPersonAndLock' at line 1
Based on you code, it seems that you need to parameter name on your sqldatasource control.
I just tried it and unfortunately it fails in the same way: missing parameter when the command is "call GetPersonAndLock" and invalid syntax when the command is "GetPersonAndLock".
I just tried it and unfortunately it fails in the same way: missing parameter when the command is "call GetPersonAndLock" and invalid syntax when the command is "GetPersonAndLock".
Based on your description, I create a simple demo as below. it works well, please check it. For policy reason, we couldn't use MySQL, I use localdb, it's similar with MySQL.
#store procedure.
USE [AspDotNetDemo]
GO
/****** Object: SqlProcedure [dbo].[Customers_SearchCustomers] Script Date: 7/6/2016 4:04:21 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[Customers_SearchCustomers]
@ContactName NVARCHAR(30)
AS
BEGIN
SET NOCOUNT ON;
SELECT CustomerId
,ContactName
,Country
FROM Customer
WHERE ContactName LIKE @ContactName + '%'
END
None
0 Points
3 Posts
Error in stored procedure call
Jun 19, 2016 09:41 PM|VictorZaslavsky|LINK
Environment: IIS 7 + MySQL 5.7.13.
Stored procedure "GetPersonAndLock" should receive parameter of type INT.
Data source configuration:
<asp:SqlDataSource ID="RundomPerson"
runat="server"
ConnectionString="<%$ ConnectionStrings:MySQLConnectionString %>"
ProviderName="<%$ ConnectionStrings:MySQLConnectionString.ProviderName %>"
SelectCommand="call GetPersonAndLock"
SelectCommandType="StoredProcedure"
>
<SelectParameters>
<asp:CookieParameter CookieName="UserId" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
Error:
ERROR [HY000] [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.13-log]Incorrect number of arguments for PROCEDURE election phone book.GetPersonAndLock; expected 1, got 0
Any advice?
P.S. By unknown reason the "Stored Procedure" radio button of the source configuration wizard is disabled. Data source configuration was edited manually.
All-Star
52683 Points
15720 Posts
Re: Error in stored procedure call
Jun 20, 2016 01:49 AM|oned_gk|LINK
Try change this
Suwandi - Non Graduate Programmer
None
0 Points
3 Posts
Re: Error in stored procedure call
Jun 20, 2016 02:40 AM|VictorZaslavsky|LINK
Hello oneg_gk,
I've tried that initially. In that case I get another error:
ERROR [42000] [MySQL][ODBC 5.3(w) Driver][mysqld-5.7.13-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GetPersonAndLock' at line 1
The stored procedure itself works correctly, I've tested it using MySQL Workbench.
Also, another stored procedure which does not have parameters works correctly when invoked from asp.net using the same connection string.
Contributor
2570 Points
501 Posts
Re: Error in stored procedure call
Jun 20, 2016 07:36 AM|Cole Wu|LINK
Hi VictorZaslavsky,
Based on you code, it seems that you need to parameter name on your sqldatasource control.
<asp:SqlDataSource ID="RundomPerson" runat="server" ConnectionString="<%$ ConnectionStrings:MySQLConnectionString %>" ProviderName="<%$ ConnectionStrings:MySQLConnectionString.ProviderName %>" SelectCommand="GetPersonAndLock" SelectCommandType="StoredProcedure" > <SelectParameters> <asp:CookieParameter CookieName="UserId" Name="UserId" Type="Int32" /> </SelectParameters> </asp:SqlDataSource>
Best regards,
Cole Wu
None
0 Points
3 Posts
Re: Error in stored procedure call
Jun 20, 2016 09:56 AM|VictorZaslavsky|LINK
Hello Cole,
Thanks for your reply.
I just tried it and unfortunately it fails in the same way: missing parameter when the command is "call GetPersonAndLock" and invalid syntax when the command is "GetPersonAndLock".
Regards,
Victor.
Contributor
2570 Points
501 Posts
Re: Error in stored procedure call
Jul 06, 2016 08:09 AM|Cole Wu|LINK
Hi VictorZaslavsky,
Based on your description, I create a simple demo as below. it works well, please check it. For policy reason, we couldn't use MySQL, I use localdb, it's similar with MySQL.
#store procedure.
#ASP
#Code Behind.
In addition, please check if the parameter name is the same with SqlDataSource CookieParameter's name.
If the issue still exist, could you please provide the store procedure.
Best regards,
Cole Wu