MySQL Forums
Forum List  »  Stored Procedures

Re: Stored procedures
Posted by: shalmi patel
Date: April 15, 2005 03:14AM

myConnection.Open();

MySqlDA.SelectCommand= new MySqlCommand("spGetCustomer ",myConnection);
MySqlDA.SelectCommand.CommandType = CommandType.StoredProcedure;

MySqlDA.SelectCommand.Parameters.Add(new MySqlParameter("?custname",MySqlDbType.VarChar,50));
MySqlDA.SelectCommand.Parameters["?custname"].Value = txtUserName.Text.ToString();
MySqlDA.SelectCommand.Parameters.Add(new MySqlParameter("?custpassword",MySqlDbType.VarChar,50));
MySqlDA.SelectCommand.Parameters["?custpassword"].Value = txtPassword.Text.ToString();
MySqlDA.SelectCommand.Prepare();

MySqlDA.Fill(objds,"CustomerMaster");

getting error
"#42000
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 'spGetCustomer' at line 1
"

and my stored procedure in mysql 5.0 is:

CREATE PROCEDURE spGetCustomer(custname varchar(100),custpassword varchar(20))
begin
select CustomerID,CustomerName,ContactID,CustomerEmailID
from customerMaster
where CustomerName=custname and CustomerPassword = custpassword;
end

its working properly with mysql client command.

but giving error when i m calling it from my asp.net application.

any solution ?????

Options: ReplyQuote


Subject
Views
Written By
Posted
4477
March 07, 2005 11:58AM
2106
March 08, 2005 02:45PM
2184
April 15, 2005 01:25AM
Re: Stored procedures
2270
April 15, 2005 03:14AM
2128
April 30, 2005 07:34AM
2072
May 03, 2005 10:49AM
2117
June 16, 2005 10:02AM
2065
June 27, 2005 05:26AM
2093
April 18, 2005 06:31AM
2081
June 20, 2005 09:14AM
2114
June 24, 2005 07:15AM
2021
June 28, 2005 01:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.