Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a problem with ExecSprocScalar and ExecSproc?
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Is there a problem with ExecSprocScalar and ExecSproc?
Miscellaneous
Thread ID:
00951047
Message ID:
00951047
Views:
75
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
Map
View

Click here to load this message in the networking platform