[dba-VB] Parameter objects in C# and ADO.

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Fri Nov 27 16:09:52 CST 2009


Hi John --

You're welcome!
I have just posted another sample code where SP call from C# is processed
asynchronously.

--
Shamil

P.S. There is an issue with the code I mentioned above - Completed flag
should be also set to true in the catch() block of the calling method:

public void TestSP()
 
-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: Saturday, November 28, 2009 12:41 AM
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] Parameter objects in C# and ADO.

Very cool!

I am rewriting the code I found on the internet to allow me to pass in the
direction as well as 
manipulate the param object when it returns.

Thanks again for the example code.

John W. Colby
www.ColbyConsulting.com


Shamil Salakhetdinov wrote:
> Hi John --
> 
> I have just posted here a sample for synchronous execution of SP with
> params.
> You can also run SPs from C# asynchronously - e.g. look MSDN for
> BeginExecuteNonQuery method of System.Data.SqlClient.SqlCommand class.
> 
> --
> Shamil
> 
> 
> -----Original Message-----
> From: dba-vb-bounces at databaseadvisors.com
> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Friday, November 27, 2009 11:26 PM
> To: Discussion concerning Visual Basic and related programming issues.
> Subject: Re: [dba-VB] Parameter objects in C# and ADO.
> 
>  > If a parameter in a stored procedure is declared as an output (returns
a
> value) will the 
> parameter  object in C# / ADO contain that value when the stored procedure
> finishes?
> 
> This part of the question got lost, not directly answered AFAICT.
> 
> I am directly creating parameter objects and adding them to the parameter
> collection of the command 
> object.  Code execution will halt until the stored procedure finishes
> executing and then the 
> parameter objects in the command object's parameters collection can be
> looked at for the returned 
> values?
> 
> John W. Colby
> www.ColbyConsulting.com
> 
> 
> jwcolby wrote:
>> If a parameter in a stored procedure is declared as an output (returns a
> value) will the parameter 
>> object in C# / ADO contain that value when the stored procedure finishes?
>>
>> I haven't used output parameters yet in stored procedures.  Can values be
> passed in via an output 
>> parameter or can it only be set from inside of the stored procedure?
>>
> 
>  

 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4643 (20091127) __________

The message was checked by ESET NOD32 Antivirus.

http://www.esetnod32.ru
 




More information about the dba-VB mailing list