I am using IDbConnection, IDbCommand, IDbDataParameter to write more generic
code to support SYbase ASA and SQL Server. The smae code for backend SQL
Server runs fine. But in Sybase ASA My store procedure doesnt work. Says
parameter is wrong to the store proc

the code is something like this (the code for connection and command is not
shown hee, I get proper connection and command object, even it shows the
following correct parameter added)

IDbDataParameter parameterPortalAlias = DBUtils.CreateDataParameter();
parameterPortalAlias.ParameterName = "Param1";
parameterPortalAlias.DbType = System.Data.DbType.String;
parameterPortalAlias.Size = 50;
parameterPortalAlias.Value = "ABC";

In the store proc the parameter is varchar(50). Store proc works fine I had
debugged it externally . What could be wrong.

Code is failing after this statement

IDataReader dr = myCommand.ExecuteReader(CommandBehavior.CloseConnection); ;

the exact error is

ERROR [42000] [Sybase][ODBC Driver][Adaptive Server Anywhere]Syntax error or
access violation: Wrong number of parameters to function 'GetAppVariables'

any idea....?