There are a few ways to do this, but one straightforward way is to put print
statements in your code, and then trap the InfoMessage event of your
connection. (I mean this as a general way to get information back from your
stored procedures). Each time a Print is encountered in your stored proc,
then it will be visible in the InfoMessage event
http://www.knowdotnet.com/articles/connections.html
The reason I recommend this is that you can exert a high degree of control
over your statements and it's VERY easy to implement.
The other way would be to store the values in a database table (along with
their respective parameters), or use a web service or dataset (serialized
locally for example) and get the values from there.
I'd
"marcmc" <ma****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Briefly, I have a loop which runs a number of sProcs from a
CheckedListBox.
Within this loop I do the following to achieve this...
GetExecRoutines()
RunExecRoutines()
I need to log to a textbox for each sProc that is run. So I tried the
following which does work but how the hell do I avoid the hard-coding and
set
up relevant parameters. ProcToExec is a string taken from a SQL Table
which
holds a value such as 'dbo.usp_MISRE_Pivot' which I use in the
RunExecRoutines() to execute the user selections.
I am banging my head off the wall and just can't see a way right now.
Please stop my head-banging.
If ProcToExec = "dbo.usp_MISRE_Pivot" Then
PivotLog()
ElseIf ProcToExec = "dbo.Routine4" Then
Routine4Log
End If