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
Miscellaneous
Thread ID:
00951047
Message ID:
00951060
Views:
10
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
Previous
Reply
Map
View

Click here to load this message in the networking platform