Share via


BreakpointTarget.HitCount Propriété

Définition

Obtient ou définit un entier qui spécifie le nombre de fois où un point d’arrêt se produit avant que le moteur d’exécution ne soit suspendu.

public:
 property int HitCount { int get(); };
public int HitCount { get; }
member this.HitCount : int
Public ReadOnly Property HitCount As Integer

Valeur de propriété

Entier contenant le nombre de fois où un point d’arrêt se produit avant que le moteur d’exécution ne soit suspendu.

Exemples

L’exemple de code suivant récupère la collection cible de points d’arrêt à partir du package et effectue une itération dans les points d’arrêt, affichant les propriétés de chaque point d’arrêt, y compris le HitCount.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  
using Microsoft.SqlServer.Dts.Tasks.BulkInsertTask;  

namespace Breakpoint_API  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Package pkg = new Package();  
            TaskHost taskHost = (TaskHost)pkg.Executables.Add("STOCK:FileSystemTask");  
            BreakpointTargets bptargets = pkg.GetBreakpointTargets(taskHost, false);  
            foreach (BreakpointTarget bpt in bptargets)  
                {  
                Console.WriteLine("BreakOnExpressionChange? {0}", bpt.BreakOnExpressionChange.ToString());  
                Console.WriteLine("Description              {0}", bpt.Description);  
                Console.WriteLine("Enabled?                 {0}", bpt.Enabled);  
                Console.WriteLine("HitCount                 {0}", bpt.HitCount);  
                Console.WriteLine("HitTarget                {0}", bpt.HitTarget);  
                Console.WriteLine("HitTest                  {0}", bpt.HitTest);  
                Console.WriteLine("ID                       {0}", bpt.ID);  
                Console.WriteLine("Owner                    {0}", bpt.Owner);  
            }  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.SqlServer.Dts.Tasks.BulkInsertTask  

Namespace Breakpoint_API  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim pkg As Package =  New Package()   
            Dim taskHost As TaskHost = CType(pkg.Executables.Add("STOCK:FileSystemTask"), TaskHost)  
            Dim bptargets As BreakpointTargets =  pkg.GetBreakpointTargets(taskHost,False)   
            Dim bpt As BreakpointTarget  
            For Each bpt In bptargets  
                Console.WriteLine("BreakOnExpressionChange? {0}", bpt.BreakOnExpressionChange.ToString())  
                Console.WriteLine("Description              {0}", bpt.Description)  
                Console.WriteLine("Enabled?                 {0}", bpt.Enabled)  
                Console.WriteLine("HitCount                 {0}", bpt.HitCount)  
                Console.WriteLine("HitTarget                {0}", bpt.HitTarget)  
                Console.WriteLine("HitTest                  {0}", bpt.HitTest)  
                Console.WriteLine("ID                       {0}", bpt.ID)  
                Console.WriteLine("Owner                    {0}", bpt.Owner)  
            Next  
        End Sub  
    End Class  
End Namespace  

Exemple de sortie :

BreakOnExpressionChange? False

Arrêt de description lorsque le conteneur reçoit l’événement OnPreExecute

Activé ? False

HitCount 0

HitTarget 0

HitTest Always

ID -2147483647

Propriétaire Microsoft.SqlServer.Dts.Runtime.TaskHost

Remarques

Pour plus d’informations sur la définition du nombre d’accès dans l’interface utilisateur, consultez Déboguer un package en définissant des points d’arrêt sur une tâche ou un conteneur.

S’applique à