Retrieve parameter names from stored procedures


Author
Message
Jeff Pagley
Jeff Pagley
StrataFrame User (469 reputation)StrataFrame User (469 reputation)StrataFrame User (469 reputation)StrataFrame User (469 reputation)StrataFrame User (469 reputation)StrataFrame User (469 reputation)StrataFrame User (469 reputation)StrataFrame User (469 reputation)StrataFrame User (469 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
I have some old code where I used the System.Data.SqlClient.SqlConnection object that is dropped onto a form for data access.   I use the connection object to retrieve parameter names of stored procedures.  I would like to convert it to use Strataframe.  Here is an example of what the code looks like now:

 

cmd = New SqlClient.SqlCommand("StoredProcedureName", Me.SQLConnection99)

cmd.CommandType = CommandType.StoredProcedure

cmd.CommandTimeout = 60

'get the parameters for the stored procedure

SqlCommandBuilder.DeriveParameters(cmd)

For Each prm As SqlParameter In cmd.Parameters

If prm.ParameterName <> "RETURN_VALUE" Then

prm.Value = datarow(prm.ParameterName)

End If

Next prm

How can I use Strataframe's connection layer to eliminate the SQL connection object (SQLConnection99) I am using now to retrieve the parameter names?  

I am sure it's simple, but I'm not seeing it.      As always, thanks for your expert help! 

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search