
Código:
Public Function EjecutaCommand_SP(ByVal SQLParametro1 As String, ByVal SQLParametro2 As String, ByVal SQLParametro3 As String, ByVal NombreSP As String) As Boolean Try BDSQLConection.Open() Dim TheCommand As New SqlClient.SqlCommand TheCommand.CommandType = CommandType.StoredProcedure TheCommand.Connection = BDSQLConection TheCommand.CommandText = NombreSP TheCommand.Parameters.AddWithValue("@p_FechaInicio", SQLParametro1) TheCommand.Parameters.AddWithValue("@p_FechaFin", SQLParametro2) TheCommand.Parameters.AddWithValue("@p_Tipo", SQLParametro3) TheCommand.ExecuteNonQuery() BDSQLConection.Close() TheCommand = Nothing EjecutaCommand_SP = True Catch ex As Exception EjecutaCommand_SP = False BDSQLConection.Close() End Try End Function
Saludos y gracias por sus respuestas.