Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a problem with ExecSprocScalar and ExecSproc?
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Is there a problem with ExecSprocScalar and ExecSproc?
Divers
Thread ID:
00951047
Message ID:
00951047
Vues:
77
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'
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform