Export (0) Print
Expand All

TeamFoundationSqlResourceComponent Class

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

public abstract class TeamFoundationSqlResourceComponent : IDisposable, 
	ICancelable

The TeamFoundationSqlResourceComponent type exposes the following members.

  NameDescription
Protected methodTeamFoundationSqlResourceComponent()Initializes a new instance of the TeamFoundationSqlResourceComponent class.If this constructor is used to instantiate the object, Initialize method must be called to finish object initialization.
Protected methodTeamFoundationSqlResourceComponent(TeamFoundationRequestContext, String)Initializes a new instance of the TeamFoundationSqlResourceComponent class.
Top

  NameDescription
Protected propertyAuthorThe author is defined as the source of the change that caused the notification. See Author for more information.
Protected propertyBoundParametersReturns the number of currently bound parameters.
Protected propertyCommandThe SQL command that is used by the SqlResourceComponent.
Protected propertyCommandTextSql text for the current command.
Protected propertyCommandTimeoutThe CommandTimeout used for all executions unless otherwise specified for a given command.
Protected propertyConnectionThe SqlConnection used by this TeamFoundationSqlResourceComponent.
Protected propertyConnectionStringThe connection string
Protected propertyContainerErrorCodeRead and Write the container error code for this component.
Public propertyDatabaseCategoryRead database category.
Protected propertyDataReaderThe SqlDataReader returned by the last SqlCommand execute.
Public propertyDataSourceGets the name or network address of the instance of SQL Server to connect to.
Protected propertyDeadlockPauseNumber of milliseconds to pause before retrying after a deadlock occurs.
Protected propertyExecutionTimeThresholdAt which time do we trace this call
Public propertyInitialCatalogGets the name of the database associated with the component.
Public propertyIsSqlAzureReturns true if component is used against SQL Azure.
Protected propertyLoggingOptionsControls whether TIME and IO statistics (or other information message output) should be collected and logged.
Protected propertyMaxDeadlockRetriesMaximum number of times to retry the operation if a deadlock occurs.
Public propertyPartitionIdThe id of the partition this component is associated with.
Protected propertyPerformanceOptionsWhether or not to obtain context information, and how much to throttle.
Protected propertyProcedureNameName of the procedure currently being executed.
Protected propertyRequestContextThe request context of the current request.
Protected propertySelectedFeaturesSelected SQL resource component options.
Protected propertyStatementIndexIndex used by the last AddStatement. -1 if AddStatement has not been called.
Protected propertyTraceAreaCan be used in trace definitions to filter tracing to a specific area.
Protected propertyTranslatedExceptionsRequests the set of SqlExceptions that can be translated to local exceptions by using a SqlExceptionFactory.
Public propertyVersionThe version of the service's schema
Top

  NameDescription
Protected methodAddStatement(String)Add a statement to the current SQL batch. You must call PrepareSqlBatch before you call AddStatement.
Protected methodAddStatement(String, Int32)Add a statement to the current SQL batch. You must call PrepareSqlBatch before you call AddStatement. If the number of parameters that will be added by using this statement will exceed the maximum number of allowed parameters in a single SQL batch, the statements that are already part of the batch will be executed, and then a new batch will begin with the statement that's being added.
Protected methodAddStatement(String, Int32, Boolean)Add a statement to the current SQL batch. You must call PrepareSqlBatch before you call AddStatement. If the number of parameters that will be added by using this statement will exceed the maximum number of allowed parameters in a single SQL batch, the statements that are already part of the batch will be executed, and then a new batch will begin with the statement that's being added.
Protected methodAddStatement(String, Int32, Boolean, Boolean)Add a statement to the current SQL batch. You must call PrepareSqlBatch before you call AddStatement. If the number of parameters that will be added by using this statement will exceed the maximum number of allowed parameters in a single SQL batch, the statements that are already part of the batch will be executed, and then a new batch will begin with the statement that's being added.
Public methodBeginTransactionUsed to wrap several calls in a single transaction. All executes on this component will be in the transaction until Commit or RollBack are called.
Protected methodBindBinary(String, Byte[], SqlDbType)This is a helper function that handles binding a binary value to a SqlParameter.
Protected methodBindBinary(String, Byte[], Int32, SqlDbType)A helper function that handles binding a binary value to a sqlparameter.
Protected methodBindBooleanA helper function that handles binding a Boolean or a bit value to a sqlparameter.
Protected methodBindByte(String, Byte)A helper function that handles binding an 8-bit value to its sqlparameters.
Protected methodBindByte(String, Byte, Byte)A helper function that handles binding an 8-bit value that might be null to its sqlparameters.
Protected methodBindDateTimeA helper function that handles binding a date/time value to a sqlparameter.
Protected methodBindDefaultA helper function that handles binding a value to default type.
Protected methodBindDoubleThis is a helper function that takes care of binding 32 bit value to their sqlparameters.
Protected methodBindGuidThis is a helper function that handles binding GUIDs to their sqlparameters.
Protected methodBindIntA helper function that handles binding a 32-bit value to its sqlparameters.
Protected methodBindLongA helper function that handles binding a 64-bit value to its sqlparameters.
Protected methodBindNullableBooleanThis is a helper function that takes care of binding boolean or a bit value to a sqlparameter.
Protected methodBindNullableByteThis is a helper function that handles binding an 8-bit value to its SqlParameters.
Protected methodBindNullableDateTimeThis is a helper function that takes care of binding a date/time value to a sqlparameter.
Protected methodBindNullableGuidA helper function that handles binding GUIDs to their sqlparameters. The value Empty is considered NULL and a NULL is bound to the given parameter.
Protected methodBindNullableIntIf parameterValue == nullValue, a NULL is bound to the given parameter. Otherwise, parameterValue is bound as a 32-bit integer.
Protected methodBindNullableShortIf parameterValue == nullValue, a NULL is bound to the given parameter. Otherwise, parameterValue is bound as a 16-bit integer
Protected methodBindNullValueThis is a generic binding helper that builds a specific parameter typed null value.
Protected methodBindShortThis is a helper function that handles binding 16 bit value to their sqlparameters.
Protected methodBindString(String, String, Int32, BindStringBehavior, SqlDbType)This is a helper function that handles binding strings to their SqlParameters. It makes sure that null values are correctly handled.
Protected methodBindString(String, String, Int32, Boolean, SqlDbType)This is a helper function that handles binding strings to their SqlParameters.It makes sure that null values are correctly handled. This is the old version of this method; use the overload that takes a BindStringBehavior to be more explicit about how null and empty strings are to be handled.
Protected methodBindSysnameA helper function that handles binding sysname strings to their sqlparameters. It makes sure null values are correctly set up.
Protected methodBindTable<T>Binds a table.
Protected methodBindVariant
Protected methodBindXml(String, TeamFoundationDatabaseXmlWriter)Used to bind an XML document to an XML parameter.
Protected methodBindXml(String, String)Used to bind an XML document to an XML parameter.
Public methodCancel
Protected methodCanRetryOnExceptionIndicates whether the SQL exception can be retried.
Protected methodCanRetryOnSqlError
Public methodCommitTransactionCommit the transaction that is active for this component.
Public methodDispose
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodExecuteInternal helper that encapsulates the logic for ExecuteReader and ExecuteNonQuery.
Protected methodExecuteNonQuery()Executes the current SQL command and does not produce a result set.
Protected methodExecuteNonQuery(Boolean)Executes the current SQL command and does not produce a result set. The only result is the Return Value, which is a single scalar value.
Protected methodExecuteReader()Overload using default command behavior.
Protected methodExecuteReader(CommandBehavior)Executes the current SQL command and returns a reader.
Protected methodExecuteScalarExecute the current SQL command by using ExecuteScalar and stores the result.
Protected methodExecuteUnknown(Object)Executes the current SQL command by using ExecuteUnknown() and returns the object.
Protected methodExecuteUnknown(SqlDataReader, Object)The method that is used by ExecuteUnknown() to populate an object based on a reader caller of ExecuteUnknown must override this method.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Protected methodFlushBatchFlushes the batch that is pended to this point and creates a new batch so that users may call AddStatement again.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Protected methodGetParameterNameHelper method to format a parameter name.
Protected methodGetSqlErrorNumberAsStringHelper that returns all the error numbers in a string for tracing purposes It's not super efficient but should only be called in case SQL is having issues which *should* be rare.
Protected methodGetSqlErrorNumbersHelper that returns all the error numbers contained in a sql exception object
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodHandleCustomExceptionHandle custom exceptions.
Protected methodHandleExceptionDetermine whether the SQL exception can be handled; SQL exceptions that cannot be retried or mapped are "unhandled."
Protected methodInitialize(String)Initializes a component.
Protected methodInitialize(TeamFoundationRequestContext, String, Int32)
Protected methodInitialize(String, Int32, Int32, Int32, Int32)Initializes a component.
Protected methodMapException(SqlException)Map a SQL exception into an application-specific exception, if it is possible. Otherwise, the exception is reported using Watson.
Protected methodMapException(SqlException, QueryExecutionState)Map a SQL exception into an application-specific exception, if it is possible. Otherwise, the exception is reported using Watson.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodPrepareConnectionStringAllows derived classes to update connection string.
Protected methodPrepareSqlBatch(Int32)Setup to execute a batch of SQL statements. This method will close all existing commands or readers.
Protected methodPrepareSqlBatch(Int32, Boolean)Setup to execute a batch of SQL statements. This method will close all existing command or reader.
Protected methodPrepareStoredProcedure(String)Setup to execute a SQL stored procedure. This method will close all existing commands or readers.
Protected methodPrepareStoredProcedure(String, Boolean)Setup to execute a SQL Server stored procedure. This method will close all existing command or reader.
Protected methodPrepareStoredProcedure(String, Int32)Setup to execute a SQL stored procedure. This method will close all existing commands or readers.
Protected methodPrepareStoredProcedure(String, Boolean, Int32)Setup to execute a SQL Server stored procedure. This method will close all existing command or reader.
Protected methodReleaseVerificationLock
Public methodRollbackTransactionRoll back and discard all changes that were made during the transaction on this component.
Protected methodSleep
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Protected methodTrace(Int32, TraceLevel, String, Object[])Push trace messages to the trace service associated with the request context.
Protected methodTrace(Int32, TraceLevel, String[], String, Object[])Push trace messages to the trace service associated with the request context.
Protected methodTraceEnterTrace entry to a method with a consistently formatted message and a time stamp.
Protected methodTraceExceptionReport an exception at TraceLevel.Error to the trace log in a consistent way.
Protected methodTraceLeaveTrace exit from a method with a consistently formatted message and a time stamp.
Protected methodTranslateExceptionExamines a SQL Type Exception and transforms it into a more significant one.The default behavior is to do nothing; that is, it is to rethrow the original exception.WIT is the only component that currently overrides the current behavior.
Public methodStatic memberTranslateSqlExceptionNot all TFS services use TeamFoundationSqlResourceComponent, but most want to use the common error handling that it contains. Therefore, a static TranslateSqlException can be used externally from the component.
Protected methodVerifyInitializedThrows an InvalidOperationException if the component is not initialized.
Protected methodVerifyInMasterDbOnAzureThrows InvalidOperationException if components is used against SQL Azure and the Initial Catalog in the connection string is not master or empty.
Protected methodVerifyNotSqlAzureThrows NotSupportedException if components are used against SQL Azure.
Public methodVerifyServiceVersion(String, Int32, Int32, Int32)Connects to the database, takes a shared session lock on the TfsDb resource and verifies that the database supports specified service version.NOTE: This method will be re-written. We must query CONTEXT_INFO(), take a shared lock and query database service version using one query. In addition, we must make sure that the database still supports current component in case we lost connection to the database.
Public methodVerifyServiceVersion(String, Int32, Int32, Int32, Boolean)This method connects to the database, takes a shared or exclusive session lock on the TfsDb resource and verifies that the database supports specified service version. NOTE: This method will be re-written. We must query CONTEXT_INFO(), take a shared lock and query database service version using one query. In addition, we must ensure that the database still supports current component in case we lost connection to the database.
Top

  NameDescription
Public eventInfoMessageExposes the internal InfoMessage event of the SqlConnection. Occurs when SQL Server returns a warning or informational message.
Top

  NameDescription
Public fieldStatic memberDatabaseTypeAccount
Public fieldStatic memberDatabaseTypeApplication
Public fieldStatic memberDatabaseTypeCollection
Public fieldStatic memberDatabaseTypeConfiguration
Public fieldStatic memberDatabaseTypeWarehouse
Public fieldStatic memberExtendedPropertyCategoriesStrings that define the instance and schema version extended properties.
Public fieldStatic memberExtendedPropertyConfigurationInProgressStamp
Public fieldStatic memberExtendedPropertyDatabaseTypeDescribes what this database is used for.
Public fieldStatic memberExtendedPropertyDeploymentTypeStamp
Public fieldStatic memberExtendedPropertyFinalConfigurationServiceLevelStamp
Public fieldStatic memberExtendedPropertyHostDeletedInfo
Public fieldStatic memberExtendedPropertyInstanceStamp Obsolete.
Public fieldStatic memberExtendedPropertyNonFrameworkInstanceStamp
Public fieldStatic memberExtendedPropertyProductVersionStamp
Public fieldStatic memberExtendedPropertyReleaseDescriptionStamp
Public fieldStatic memberExtendedPropertyRemoveStepsSucceededStamp
Public fieldStatic memberExtendedPropertySchemaVersion
Public fieldStatic memberExtendedPropertyServiceLevelStamp
Public fieldStatic memberExtendedPropertyServiceLevelToStamp
Public fieldStatic memberMaxStatementLengthEstimateWhen preparing SQL batches, a length estimate is passed in. This caps the maximum size for the estimate.
Public fieldStatic memberSchemaVersionCurrent schema version for the Team Foundation database.
Public fieldStatic memberSqlMaxBatchParametersThe maximum number of [SqlParameters] that can be bound to a single batch.The SQL Server hard limit is 2100, ADO.NET uses 2 for the sp_executesql call-batch text and parameter list.
Top

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft