• DataStax Enterprise C# Driver API Documentation

    Show / Hide Table of Contents
    • Dse
      • AggregateMetadata
      • AlreadyExistsException
      • AtomicMonotonicTimestampGenerator
      • AtomicMonotonicWinApiTimestampGenerator
      • AuthenticationException
      • BatchStatement
      • BatchType
      • BigIntegerTypeAdapter
      • BoundStatement
      • Builder
      • BusyPoolException
      • CassandraConnectionStringBuilder
      • ClientOptions
      • Cluster
      • ColumnDesc
      • ColumnTypeCode
      • CompressionType
      • Configuration
      • ConsistencyLevel
      • ConstantReconnectionPolicy
      • ConstantSpeculativeExecutionPolicy
      • CqlColumn
      • CustomColumnInfo
      • DataCollectionMetadata
      • DataCollectionMetadata.SortOrder
      • DCAwareRoundRobinPolicy
      • DecimalTypeAdapter
      • DefaultRetryPolicy
      • Diagnostics
      • DowngradingConsistencyRetryPolicy
      • DriverException
      • DriverInternalError
      • DseCluster
      • DseClusterBuilder
      • DseConfiguration
      • DseLoadBalancingPolicy
      • Duration
      • DynamicCompositeTypeAdapter
      • EC2MultiRegionTranslator
      • ExecutionException
      • ExecutionInfo
      • ExponentialReconnectionPolicy
      • Extensions
      • FallthroughRetryPolicy
      • FixedReconnectionPolicy
      • FunctionFailureException
      • FunctionMetadata
      • Host
      • HostDistance
      • HostsEventArgs
      • HostsEventArgs.Kind
      • HostsEventHandler
      • IAddressTranslator
      • IAuthenticator
      • IAuthProvider
      • IAuthProviderNamed
      • ICluster
      • IColumnInfo
      • IdempotenceAwareRetryPolicy
      • IDseCluster
      • IDseSession
      • IExecutionProfile
      • IExecutionProfileBuilder
      • IExecutionProfileOptions
      • IExtendedRetryPolicy
      • IFrameCompressor
      • IInitializer
      • ILoadBalancingPolicy
      • IndexMetadata
      • IndexMetadata.IndexKind
      • InvalidConfigurationInQueryException
      • InvalidQueryException
      • InvalidTypeException
      • IReconnectionPolicy
      • IReconnectionSchedule
      • IRetryPolicy
      • IsBootstrappingException
      • ISession
      • ISessionState
      • ISpeculativeExecutionPlan
      • ISpeculativeExecutionPolicy
      • IStatement
      • ITimestampGenerator
      • ITypeAdapter
      • KeyspaceMetadata
      • KeyType
      • ListColumnInfo
      • LocalDate
      • LocalTime
      • Logger
      • LoggingRetryPolicy
      • MapColumnInfo
      • MaterializedViewMetadata
      • Metadata
      • MetadataSyncOptions
      • MetricsExtensions
      • MonitorReportingOptions
      • NoHostAvailableException
      • NoneAuthProvider
      • NoSpeculativeExecutionPolicy
      • NullTypeAdapter
      • OperationTimedOutException
      • OverloadedException
      • PlainTextAuthProvider
      • Policies
      • PoolingOptions
      • PreparedQueryNotFoundException
      • PreparedStatement
      • PreparedStatementIdMismatchException
      • ProtocolErrorException
      • ProtocolOptions
      • ProtocolVersion
      • QueryExecutionException
      • QueryOptions
      • QueryProtocolOptions
      • QueryProtocolOptions.QueryFlags
      • QueryTimeoutException
      • QueryTrace
      • QueryTrace.Event
      • QueryValidationException
      • ReadFailureException
      • ReadTimeoutException
      • RegularStatement
      • ReplicationStrategies
      • RequestInvalidException
      • RetryDecision
      • RetryDecision.RetryDecisionType
      • RetryLoadBalancingPolicy
      • RetryLoadBalancingPolicyEventArgs
      • RoundRobinPolicy
      • RoutingKey
      • Row
      • RowSet
      • RowSetMetadata
      • SchemaChangedEventArgs
      • SchemaChangedEventArgs.Kind
      • SchemaChangedEventHandler
      • ServerErrorException
      • Session
      • SetColumnInfo
      • SimpleStatement
      • SocketOptions
      • SSLOptions
      • Statement
      • SyntaxError
      • TableColumn
      • TableMetadata
      • TableOptions
      • TimeUuid
      • TokenAwarePolicy
      • ToManyConnectionsPerHost
      • TraceRetrievalException
      • TruncateException
      • TupleColumnInfo
      • TypeAdapters
      • UdtColumnInfo
      • UdtMap
      • UdtMap<T>
      • UdtMappingDefinitions
      • UnauthorizedException
      • UnavailableException
      • Unset
      • WriteFailureException
      • WriteTimeoutException
    • Dse.AppMetrics
      • DriverAppMetricsOptions
    • Dse.AppMetrics.MetricTypes
      • IAppMetricsCounter
      • IAppMetricsGauge
      • IAppMetricsMeter
      • IAppMetricsMetric
      • IAppMetricsTimer
    • Dse.AppMetrics.MetricValues
      • IAppMetricsHistogramValue
      • IAppMetricsMeterValue
      • IAppMetricsMetricWithValue<T>
      • IAppMetricsTimerValue
    • Dse.Auth
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
    • Dse.Auth.Sspi
      • SspiException
    • Dse.Data
      • CqlBatchTransaction
      • CqlCommand
      • CqlConnection
      • CqlDataAdapter
      • CqlParameter
      • CqlParameterCollection
      • CqlProviderFactory
      • CqlReader
    • Dse.Data.Linq
      • AllowFilteringAttribute
      • Batch
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CompactStorageAttribute
      • CounterAttribute
      • CqlArgumentException
      • CqlCommand
      • CqlConditionalCommand<TEntity>
      • CqlDelete
      • CqlFunction
      • CqlInsert<TEntity>
      • CqlLinqNotSupportedException
      • CqlOperator
      • CqlQuery<TEntity>
      • CqlQueryBase<TEntity>
      • CqlQueryExtensions
      • CqlQuerySingleElement<TEntity>
      • CqlScalar<TEntity>
      • CqlToken
      • CqlUpdate
      • IgnoreAttribute
      • ITable
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • SessionExtensions
      • StaticColumnAttribute
      • Table<TEntity>
      • TableAttribute
      • TableType
    • Dse.Geometry
      • GeometryBase
      • LineString
      • Point
      • Polygon
    • Dse.Graph
      • Edge
      • Element
      • GraphNode
      • GraphOptions
      • GraphResultSet
      • GraphStatement
      • IEdge
      • IElement
      • IGraphNode
      • IGraphStatement
      • IPath
      • IProperty
      • IVertex
      • IVertexProperty
      • Path
      • SimpleGraphStatement
      • Vertex
    • Dse.Mapping
      • AppliedInfo<T>
      • ColumnMap
      • Cql
      • CqlQueryOptions
      • IColumnDefinition
      • ICqlBatch
      • ICqlQueryAsyncClient
      • ICqlQueryClient
      • ICqlWriteAsyncClient
      • ICqlWriteClient
      • IMapper
      • IPage<T>
      • ITypeDefinition
      • Map<TPoco>
      • Mapper
      • MappingConfiguration
      • Mappings
      • SortOrder
    • Dse.Mapping.Attributes
      • ClusteringKeyAttribute
      • ColumnAttribute
      • CounterAttribute
      • FrozenAttribute
      • FrozenKeyAttribute
      • FrozenValueAttribute
      • IgnoreAttribute
      • PartitionKeyAttribute
      • SecondaryIndexAttribute
      • StaticColumnAttribute
      • TableAttribute
    • Dse.Mapping.TypeConversion
      • DefaultTypeConverter
      • EnumStringMapper<T>
      • NullableEnumStringMapper<T>
      • TypeConverter
    • Dse.Mapping.Utils
      • MemberInfoExtensions
    • Dse.Metrics
      • DriverMetricsOptions
      • IDriverMetrics
      • IMetric
      • IMetricsRegistry<TMetric>
      • NodeMetric
      • NodeMetric.Counters
      • NodeMetric.Gauges
      • NodeMetric.Meters
      • NodeMetric.Timers
      • SessionMetric
      • SessionMetric.Counters
      • SessionMetric.Gauges
      • SessionMetric.Meters
      • SessionMetric.Timers
    • Dse.Metrics.Abstractions
      • IDriverCounter
      • IDriverGauge
      • IDriverMeter
      • IDriverMetric
      • IDriverMetricsProvider
      • IDriverTimer
    • Dse.Search
      • DateRange
      • DateRangeBound
      • DateRangePrecision
    • Dse.Serialization
      • CustomTypeSerializer<T>
      • TypeSerializer
      • TypeSerializer<T>
      • TypeSerializerDefinitions
      • UdtSerializer

    Class CqlConnection

    Represents a CQL connection.

    Inheritance
    System.Object
    System.MarshalByRefObject
    System.ComponentModel.Component
    System.Data.Common.DbConnection
    CqlConnection
    Implements
    System.ComponentModel.IComponent
    System.Data.IDbConnection
    System.IDisposable
    System.ICloneable
    Inherited Members
    System.Data.Common.DbConnection.BeginTransaction()
    System.Data.Common.DbConnection.BeginTransaction(System.Data.IsolationLevel)
    System.Data.Common.DbConnection.CreateCommand()
    System.Data.Common.DbConnection.EnlistTransaction(System.Transactions.Transaction)
    System.Data.Common.DbConnection.GetSchema()
    System.Data.Common.DbConnection.GetSchema(System.String)
    System.Data.Common.DbConnection.GetSchema(System.String, System.String[])
    System.Data.Common.DbConnection.OnStateChange(System.Data.StateChangeEventArgs)
    System.Data.Common.DbConnection.OpenAsync()
    System.Data.Common.DbConnection.OpenAsync(System.Threading.CancellationToken)
    System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction()
    System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction(System.Data.IsolationLevel)
    System.Data.Common.DbConnection.System.Data.IDbConnection.CreateCommand()
    System.Data.Common.DbConnection.ConnectionTimeout
    System.Data.Common.DbConnection.StateChange
    System.ComponentModel.Component.Dispose()
    System.ComponentModel.Component.GetService(System.Type)
    System.ComponentModel.Component.ToString()
    System.ComponentModel.Component.CanRaiseEvents
    System.ComponentModel.Component.Container
    System.ComponentModel.Component.DesignMode
    System.ComponentModel.Component.Events
    System.ComponentModel.Component.Site
    System.ComponentModel.Component.Disposed
    System.MarshalByRefObject.GetLifetimeService()
    System.MarshalByRefObject.InitializeLifetimeService()
    System.MarshalByRefObject.MemberwiseClone(System.Boolean)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Dse.Data
    Assembly: Dse.dll
    Syntax
    public class CqlConnection : DbConnection, IComponent, IDbConnection, IDisposable, ICloneable

    Constructors

    CqlConnection()

    Initializes a CqlConnection.

    Declaration
    public CqlConnection()

    CqlConnection(String)

    Initializes a CqlConnection.

    Declaration
    public CqlConnection(string connectionString)
    Parameters
    Type Name Description
    System.String connectionString

    The connection string.

    Fields

    ManagedConnection

    Declaration
    protected ISession ManagedConnection
    Field Value
    Type Description
    ISession

    Properties

    ConnectionString

    Declaration
    public override string ConnectionString { get; set; }
    Property Value
    Type Description
    System.String
    Overrides
    System.Data.Common.DbConnection.ConnectionString

    Database

    Returns the Keyspace

    Declaration
    public override string Database { get; }
    Property Value
    Type Description
    System.String
    Overrides
    System.Data.Common.DbConnection.Database

    DataSource

    Declaration
    public override string DataSource { get; }
    Property Value
    Type Description
    System.String
    Overrides
    System.Data.Common.DbConnection.DataSource

    DbProviderFactory

    Declaration
    protected override DbProviderFactory DbProviderFactory { get; }
    Property Value
    Type Description
    System.Data.Common.DbProviderFactory
    Overrides
    System.Data.Common.DbConnection.DbProviderFactory

    ServerVersion

    Declaration
    public override string ServerVersion { get; }
    Property Value
    Type Description
    System.String
    Overrides
    System.Data.Common.DbConnection.ServerVersion

    State

    Declaration
    public override ConnectionState State { get; }
    Property Value
    Type Description
    System.Data.ConnectionState
    Overrides
    System.Data.Common.DbConnection.State

    Methods

    BeginDbTransaction(IsolationLevel)

    Declaration
    protected override DbTransaction BeginDbTransaction(IsolationLevel isolationLevel)
    Parameters
    Type Name Description
    System.Data.IsolationLevel isolationLevel
    Returns
    Type Description
    System.Data.Common.DbTransaction
    Overrides
    System.Data.Common.DbConnection.BeginDbTransaction(System.Data.IsolationLevel)

    ChangeDatabase(String)

    Declaration
    public override void ChangeDatabase(string databaseName)
    Parameters
    Type Name Description
    System.String databaseName
    Overrides
    System.Data.Common.DbConnection.ChangeDatabase(System.String)

    Clone()

    Declaration
    public object Clone()
    Returns
    Type Description
    System.Object

    Close()

    Declaration
    public override void Close()
    Overrides
    System.Data.Common.DbConnection.Close()

    CreateCluster(CassandraConnectionStringBuilder)

    Creates a Cluster. By default Clusters are created and cached by cluster name specified in connection string.

    To be overridden in child classes to change the default creation and caching behavior.

    Declaration
    protected virtual Cluster CreateCluster(CassandraConnectionStringBuilder connectionStringBuilder)
    Parameters
    Type Name Description
    CassandraConnectionStringBuilder connectionStringBuilder

    The CassandraConnectionStringBuilder.

    Returns
    Type Description
    Cluster

    CreateDbCommand()

    Declaration
    protected override DbCommand CreateDbCommand()
    Returns
    Type Description
    System.Data.Common.DbCommand
    Overrides
    System.Data.Common.DbConnection.CreateDbCommand()

    CreatedSession(String)

    Creates a ISession.

    To be overridden in child classes if want to cache the ISession created.

    Declaration
    protected virtual ISession CreatedSession(string keyspace)
    Parameters
    Type Name Description
    System.String keyspace

    The keyspace.

    Returns
    Type Description
    ISession

    Returns the created ISession.

    CreatePreparedStatement(String)

    To be called by CqlCommand to creates a PreparedStatement from ManagedConnection.

    To be overridden in child classes if want to cache the PreparedStatement created.

    Declaration
    protected virtual PreparedStatement CreatePreparedStatement(string cqlQuery)
    Parameters
    Type Name Description
    System.String cqlQuery

    The CQL query string.

    Returns
    Type Description
    PreparedStatement

    Returns the created PreparedStatement.

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    System.ComponentModel.Component.Dispose(System.Boolean)

    OnBuildingCluster(Builder)

    To be overridden in child classes to change the default Builder settings for building a Cluster.

    For example, some clients might want to specify the DCAwareRoundRobinPolicy when building the Cluster so that the clients could talk to only the hosts in specified datacenter for better performance.

    Declaration
    protected virtual void OnBuildingCluster(Builder builder)
    Parameters
    Type Name Description
    Builder builder

    The Builder for building a Cluster.

    Open()

    Declaration
    public override void Open()
    Overrides
    System.Data.Common.DbConnection.Open()

    Implements

    System.ComponentModel.IComponent
    System.Data.IDbConnection
    System.IDisposable
    System.ICloneable
    Back to top © DataStax, All rights reserved.