Re: SQLHeper ExecuteNonQuery - returning values by Teemu
Teemu
Thu Jan 27 08:46:44 CST 2005
Yes it does, if you declare parameter objects for it explictly. Have you
tried this?
--
Teemu Keiski
ASP.NET MVP, Finland
"Paul Aspinall" <paul@aspy.co.uk> wrote in message
news:WA1Kd.244436$Z7.425@fe2.news.blueyonder.co.uk...
> Hi - Thanks for the reply.
>
> I am familiar with output parameters from T-SQL, however, I cannot seem to
> return values specifically using the SQL Application Blocks (SQLHelper).
>
> Does SQLHelper support output params?
>
> Thanks
>
>
> "Teemu Keiski" <joteke@aspalliance.com> wrote in message
> news:%23bzERLEBFHA.2428@TK2MSFTNGP14.phx.gbl...
>> Hi,
>>
>> if you use ExecuteNonQuery, the way to return values is within output
>> parameters. In SQL documentation there are lots of about output
>> parameters however basically it is a proc parameter specified with OUTPUT
>> keyword. For example
>>
>> CREATE PPROCEDURE myProc
>> ...
>> @newid int OUTPUT
>> AS
>> ...
>> /* set the value of the parameter somewhere here */
>>
>> After the call to ExecuteNonQuery, this value is readable from the
>> SqlParameter given to the proc (which matches the @newid )
>>
>> --
>> Teemu Keiski
>> ASP.NET MVP, Finland
>>
>> "Paul Aspinall" <paul@aspy.co.uk> wrote in message
>> news:0kVJd.36195$2b6.13294@fe3.news.blueyonder.co.uk...
>>> Hi
>>> I have a Stored Proc in SQL server, which creates a record key when a
>>> record is created.
>>>
>>> I want to return the value back to my code, once the record has been
>>> created.
>>>
>>> I am using SQLHelper (Data Application Blocks for SQLServer), and
>>> calling the ExecuteNonQuery method in the SQLHelper class...
>>>
>>> Does anyone have any sample code from their C# code, or T-SQL code to
>>> help??
>>>
>>> Thanks
>>>
>>>
>>> Paul
>>>
>>
>>
>
>