Subject Stored procedure thru C#
Author Mahesh Ishwar
I'm executing my inline queries from C# code, and they are working fine. But as soon as convert them in stored procedure, and now try to execute these, it gives me 'unknown token <name of the stored procedure>'.

I've set the Command object type to stored procedure and command text to name of the stored procedure. Along with that I've also set the Parameters. I don't know whay it is giving me error.

Here is the code..


FbConnection myConnection = new FbConnection(connectionString);


FbTransaction myTransaction = myConnection.BeginTransaction();
FbCommand fbCommand = new FbCommand();
fbCommand.Connection = myConnection;
fbCommand.Transaction = myTransaction;
stirng _commandString = "proc_migrate_data";
fbCommand.CommandText = _commandString;
fbCommand.CommandType = System.Data.CommandType.StoredProcedure;

FbParameter[] fbParameter = new FbParameter[2];
fbParameter[0] = new FbParameter("p_activity_id",FbType.VarChar);
fbParameter[0].Value = "871574628";
fbParameter[1] = new FbParameter("p_order_id",FbType.VarChar);
fbParameter[1].Value = "O596ba32b1ff8d8a4:25f3e5:f68a395d1f:-7faa";
fbParameter[2] = new FbParameter("p_success",FbType.Char);
fbParameter[2].Direction = System.Data.ParameterDirection.Output;


int intNumberOfRecordsAffected = fbCommand.ExecuteNonQuery();

And teh signature of my stored procedure is

PROCEDURE proc_migrate_data(p_activity_id VARCHAR(255), p_order_id VARCHAR(255))
RETURNS (p_success CHAR(1)) AS BEGIN ... END


Has anyone faced this problem.

Thanx in advance.


Yahoo! Plus - For a better Internet experience

[Non-text portions of this message have been removed]