MySQL Forums
Forum List  »  Stored Procedures

Re: Stored procedures
Posted by: shalmi patel
Date: April 15, 2005 01:25AM

i m having the same prob :

my code is:

OdbcDA = new OdbcDataAdapter();
OdbcCommand cmdSelect = new OdbcCommand();
OdbcConnection connOdbc = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver}; Server=220.226.204.84; Database=websitedev; UID=root; PWD=webgsl; Option=3");
OdbcDA.SelectCommand = cmdSelect;

cmdSelect.CommandText = "call spGetCustomer(?,?)";
cmdSelect.CommandType = CommandType.StoredProcedure;
cmdSelect.Connection = connOdbc;

cmdSelect.Parameters.Add(new OdbcParameter("custname",OdbcType.VarChar,50));
cmdSelect.Parameters["custname"].Value = txtUserName.Text.ToString();

cmdSelect.Parameters.Add(new OdbcParameter("custpassword",OdbcType.VarChar,50));
cmdSelect.Parameters["custpassword"].Value = txtPassword.Text.ToString();
OdbcDA.Fill(objds,"CustomerMaster");

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
4467
March 07, 2005 11:58AM
2101
March 08, 2005 02:45PM
Re: Stored procedures
2181
April 15, 2005 01:25AM
2266
April 15, 2005 03:14AM
2123
April 30, 2005 07:34AM
2069
May 03, 2005 10:49AM
2110
June 16, 2005 10:02AM
2060
June 27, 2005 05:26AM
2089
April 18, 2005 06:31AM
2075
June 20, 2005 09:14AM
2110
June 24, 2005 07:15AM
2016
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.