Share via


BreakpointTarget.HitCount Propiedad

Definición

Obtiene o establece un entero que especifica el número de veces que se produce un punto de interrupción antes de que se suspenda el motor en tiempo de ejecución.

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

Valor de propiedad

Entero que contiene el número de veces que se produce un punto de interrupción antes de que se suspenda el motor en tiempo de ejecución.

Ejemplos

En el ejemplo de código siguiente se recupera la colección de destino del punto de interrupción del paquete y se recorren en iteración los puntos de interrupción, donde se muestran las propiedades de cada punto de interrupción, incluido 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  

Salida del ejemplo:

BreakOnExpressionChange? Falso

Descripción Se interrumpe cuando el contenedor recibe el evento OnPreExecute.

¿Habilitado? Falso

HitCount 0

HitTarget 0

HitTest Always

Id. -2147483647

Propietario Microsoft.SqlServer.Dts.Runtime.TaskHost

Comentarios

Para obtener más información sobre cómo establecer el número de llamadas en la interfaz de usuario, vea Depurar un paquete estableciendo puntos de interrupción en una tarea o un contenedor.

Se aplica a