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
Divers
Thread ID:
00951047
Message ID:
00951060
Vues:
11
Theo,

As it applies to MM, I don't know if this is correct (because I don't use MM), but have you tried using ExecuteNonQuery() instead?

~~Bonnie



>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'
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform