Edit

Share via


SqlTrackingQuery Constructors

Definition

Initializes a new instance of the SqlTrackingQuery class.

Overloads

SqlTrackingQuery()

Initializes a new instance of the SqlTrackingQuery class.

SqlTrackingQuery(String)

Initializes a new instance of the SqlTrackingQuery class.

SqlTrackingQuery()

Initializes a new instance of the SqlTrackingQuery class.

public:
 SqlTrackingQuery();
public SqlTrackingQuery ();
Public Sub New ()

Remarks

The parameterless constructor initializes ConnectionString to a null reference (Nothing in Visual Basic). You must set ConnectionString before you call GetWorkflows or TryGetWorkflow or an InvalidOperationException will be thrown.

Applies to

SqlTrackingQuery(String)

Initializes a new instance of the SqlTrackingQuery class.

public:
 SqlTrackingQuery(System::String ^ connectionString);
public SqlTrackingQuery (string connectionString);
new System.Workflow.Runtime.Tracking.SqlTrackingQuery : string -> System.Workflow.Runtime.Tracking.SqlTrackingQuery
Public Sub New (connectionString As String)

Parameters

connectionString
String

The connection string of the SQL database to query.

Exceptions

connectionString is a null reference (Nothing in Visual Basic).

Examples

The following code example demonstrates how to use the SqlTrackingQuery to create an instance of the SqlTrackingQuery class.

This code example is part of the Workflow Monitor SDK Sample from the DatabaseService.cs file. For more information, see Workflow Monitor.

internal bool TryGetWorkflow(Guid workflowInstanceId, out SqlTrackingWorkflowInstance sqlTrackingWorkflowInstance)
{
    SqlTrackingQuery sqlTrackingQuery = new SqlTrackingQuery(connectionString);
    return sqlTrackingQuery.TryGetWorkflow(workflowInstanceId, out sqlTrackingWorkflowInstance);
}
Friend Function TryGetWorkflow(ByVal workflowInstanceId As Guid, ByVal sqlTrackingWorkflowInstance As SqlTrackingWorkflowInstance) As Boolean
    Dim SqlTrackingQuery As New SqlTrackingQuery(connectionString)
    Return SqlTrackingQuery.TryGetWorkflow(workflowInstanceId, sqlTrackingWorkflowInstance)
End Function

Remarks

The ConnectionString property is initialized to connectionString.

See also

Applies to