General information
Category:
The Mere Mortals .NET Framework
Title:
Is there a problem with ExecSprocScalar and ExecSproc?
I'm trying to retrieve a string as output from a stored procedure using ExecSprocScalar and ExecSproc and can't seem to do it. Am I missing something?
public string sbtUserInitials(string logonUser)
{
string result = "";
mmDataAccessBase dao = this.GetDataAccessObject();
IDbDataParameter param1 = dao.CreateParameter("@McF_logon_user", logonUser);
IDbDataParameter param2 = dao.CreateParameter("@McF_result", result) ;
param2.Direction = ParameterDirection.Output;
IDbCommand cmd;
this.ExecSprocScalar("McF_sp_PP_get_user_intitials_VFP",out cmd, param1, param2);
IDbDataParameter param = (IDbDataParameter)cmd.Parameters["@McF_result"];
string x = (string)param2.Value;
}
My stored procedure looks something like this:
CREATE PROCEDURE McF_sp_PP_get_user_intitials_VFP
@McF_logon_user varchar(30),
@McF_result char(3) OUTPUT
AS
select @McF_result = 'AAA'
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only