you would use DeriveParameters command of the CommandBuilder object ...
VB Code:
Private Overloads Function DiscoverSpParameterSet(ByVal connection As System.Data.SqlClient.SqlConnection, _
ByVal spName As String, _
ByVal includeReturnValueParameter As Boolean) As System.Data.SqlClient.SqlCommand
If (connection Is Nothing) Then Throw New ArgumentNullException("connection")
If (spName Is Nothing OrElse spName.Length = 0) Then Throw New ArgumentNullException("spName")
Dim command As New System.Data.SqlClient.SqlCommand(spName, connection)
Dim discoveredParameters() As SqlParameter
command.CommandType = CommandType.StoredProcedure
OpenConnection(connection)
SqlCommandBuilder.DeriveParameters(command)
If Not includeReturnValueParameter Then
command.Parameters.RemoveAt(0)
End If
Dim i As Integer
For i = 0 To command.Parameters.Count - 1
command.Parameters(i).Value = DBNull.Value
Next
Return command
End Function