21 instantiations of SqlConnection
System.Activities.DurableInstancing (1)
System\Activities\DurableInstancing\StoreUtilities.cs (1)
48
SqlConnection connection = new
SqlConnection
(connectionString);
System.Data (6)
fx\src\data\Microsoft\SqlServer\Server\sqlpipe.cs (1)
56
using ( SqlConnection newConnection = new
SqlConnection
( "Context Connection=true" ) ) {
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (2)
302
public SqlBulkCopy(string connectionString) : this (new
SqlConnection
(connectionString)) {
306
_connection = new
SqlConnection
(connectionString);
fx\src\data\System\Data\SqlClient\SqlConnection.cs (1)
1053
SqlConnection clone = new
SqlConnection
(this);
fx\src\data\System\Data\SqlClient\SqlDataAdapter.cs (1)
41
SqlConnection connection = new
SqlConnection
(selectConnectionString);
fx\src\data\System\Data\SqlClient\SqlDependencyListener.cs (1)
115
_con = new
SqlConnection
(_hashHelper.ConnectionStringBuilder.ConnectionString); // Create connection and open.
System.Data.Entity (1)
System\Data\SqlClient\SqlProviderServices.cs (1)
1095
using (var masterConnection = new
SqlConnection
(connectionBuilder.ConnectionString))
System.Web (7)
Cache\SqlCacheDependency.cs (2)
1493
sqlConnection = new
SqlConnection
(connectionString);
1688
sqlConn = new
SqlConnection
(connectionString);
DataAccess\SqlConnectionHelper.cs (2)
262
SqlConnection connection = new
SqlConnection
(connectionString);
291
_Connection = new
SqlConnection
(connectionString);
Management\SqlServices.cs (1)
732
sqlConnection = new
SqlConnection
(connectionString);
State\sqlstateclientmanager.cs (2)
190
dummyConnection = new
SqlConnection
(sqlConnectionString);
1187
_sqlConnection = new
SqlConnection
(sqlPartitionInfo.SqlConnectionString);
System.Web.Extensions (1)
ClientServices\Providers\SqlHelper.cs (1)
61
DbConnection connection = new
SqlConnection
(connectionString);
System.Workflow.Runtime (3)
Hosting\DbResourceAllocator.cs (1)
155
connection = new
SqlConnection
(connectionStr);
Tracking\SqlTrackingQuery.cs (1)
161
SqlConnection conn = new
SqlConnection
(_connectionString);
Tracking\SqlTrackingWorkflowInstance.cs (1)
815
using (SqlConnection conn = new
SqlConnection
(_connectionString))
System.WorkflowServices (2)
System\ServiceModel\Persistence\SqlPersistenceProviderFactory.cs (2)
542
SqlConnection connection = new
SqlConnection
(GetConnectionString(timeout));
568
using (SqlConnection connection = new
SqlConnection
(GetConnectionString(timeout)))
216 references to SqlConnection
System.Activities.DurableInstancing (2)
System\Activities\DurableInstancing\StoreUtilities.cs (2)
46
public static
SqlConnection
CreateConnection(string connectionString)
48
SqlConnection
connection = new SqlConnection(connectionString);
System.Data (127)
fx\src\data\Microsoft\SqlServer\Server\sqlpipe.cs (2)
52
SqlConnection
connection = command.Connection;
56
using (
SqlConnection
newConnection = new SqlConnection( "Context Connection=true" ) ) {
fx\src\data\System\Data\SqlClient\SqlBulkCopy.cs (12)
238
private
SqlConnection
_connection;
281
public SqlBulkCopy(
SqlConnection
connection) {
289
public SqlBulkCopy(
SqlConnection
connection, SqlBulkCopyOptions copyOptions, SqlTransaction externalTransaction)
1463
SqlConnection
.ExecutePermission.Demand();
1493
SqlConnection
.ExecutePermission.Demand();
1527
SqlConnection
.ExecutePermission.Demand();
1556
SqlConnection
.ExecutePermission.Demand();
1599
SqlConnection
.ExecutePermission.Demand();
1647
SqlConnection
.ExecutePermission.Demand();
1679
SqlConnection
.ExecutePermission.Demand();
1717
SqlConnection
.ExecutePermission.Demand();
2005
SqlConnection
connection = _connection;
fx\src\data\System\Data\SqlClient\SqlCommand.cs (24)
120
private
SqlConnection
_activeConnection;
170
private
SqlConnection
_cachedAsyncConnection = null; // Used to validate that the connection hasn't changed when end the connection;
195
internal bool IsActiveConnectionValid(
SqlConnection
activeConnection) {
213
internal void SetActiveConnectionAndResult(TaskCompletionSource<object> completion, string endMethod,
SqlConnection
activeConnection) {
408
public SqlCommand(string cmdText,
SqlConnection
connection) : this() {
413
public SqlCommand(string cmdText,
SqlConnection
connection, SqlTransaction transaction) : this() {
419
public SqlCommand(string cmdText,
SqlConnection
connection, SqlTransaction transaction, SqlCommandColumnEncryptionSetting columnEncryptionSetting) : this() {
448
new public
SqlConnection
Connection {
523
Connection = (
SqlConnection
)value;
827
SqlConnection
.ExecutePermission.Demand();
1125
SqlConnection
.ExecutePermission.Demand();
1182
SqlConnection
.ExecutePermission.Demand();
1216
SqlConnection
.ExecutePermission.Demand();
1245
SqlConnection
.ExecutePermission.Demand();
1693
SqlConnection
.ExecutePermission.Demand();
1736
SqlConnection
.ExecutePermission.Demand();
2000
SqlConnection
.ExecutePermission.Demand();
2005
SqlConnection
.ExecutePermission.Demand(); //
2408
SqlConnection
.ExecutePermission.Demand();
2472
SqlConnection
.ExecutePermission.Demand();
2576
SqlConnection
.ExecutePermission.Demand();
3050
SqlConnection
.VerifyExecutePermission();
4791
SqlConnection
connection = _activeConnection;
6020
var
activeConnection = _activeConnection;
fx\src\data\System\Data\SqlClient\SqlCommandBuilder.cs (1)
207
SqlConnection
.ExecutePermission.Demand();
fx\src\data\System\Data\SqlClient\SqlCommandSet.cs (2)
89
internal
SqlConnection
Connection {
251
SqlConnection
.ExecutePermission.Demand();
fx\src\data\System\Data\SqlClient\SqlConnection.cs (6)
341
private SqlConnection(
SqlConnection
connection) { // Clone
1039
static public void ClearPool(
SqlConnection
connection) {
1053
SqlConnection
clone = new SqlConnection(this);
1360
tdsConn.GetSessionAndReconnectIfNeeded((
SqlConnection
)this);
1454
SqlConnection
_parent;
1459
public OpenAsyncRetry(
SqlConnection
parent, TaskCompletionSource<DbConnectionInternal> retry, TaskCompletionSource<object> result, CancellationTokenRegistration registration) {
fx\src\data\System\Data\SqlClient\SqlConnectionFactory.cs (18)
44
SqlConnection
sqlOwningConnection = owningConnection as
SqlConnection
;
254
SqlConnection
c = (connection as
SqlConnection
);
262
SqlConnection
c = (connection as
SqlConnection
);
270
SqlConnection
c = (connection as
SqlConnection
);
278
SqlConnection
c = (outerConnection as
SqlConnection
);
285
SqlConnection
c = (outerConnection as
SqlConnection
);
292
SqlConnection
c = (owningObject as
SqlConnection
);
299
SqlConnection
c = (owningObject as
SqlConnection
);
307
SqlConnection
c = (owningObject as
SqlConnection
);
fx\src\data\System\Data\SqlClient\SqlConnectionStringBuilder.cs (1)
1401
using(
SqlConnection
connection = new SqlConnection()) {
fx\src\data\System\Data\SqlClient\SqlDataAdapter.cs (2)
41
SqlConnection
connection = new SqlConnection(selectConnectionString);
45
public SqlDataAdapter(string selectCommandText,
SqlConnection
selectConnection) : this() {
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (8)
50
private
SqlConnection
_connection;
106
SqlConnection
.VerifyExecutePermission();
141
protected
SqlConnection
Connection {
2444
var
connection = _connection;
2604
var
connection = _connection;
3277
SqlConnection
con = _connection;
3285
SqlConnection
con = _connection;
3293
SqlConnection
con = _connection;
fx\src\data\System\Data\SqlClient\SqlDelegatedTransaction.cs (4)
78
SqlConnection
usersConnection = connection.Connection;
146
SqlConnection
usersConnection = connection.Connection;
233
SqlConnection
usersConnection = connection.Connection;
316
SqlConnection
usersConnection = connection.Connection;
fx\src\data\System\Data\SqlClient\SqlDependency.cs (1)
1105
SqlConnection
connection = cmd.Connection;
fx\src\data\System\Data\SqlClient\SqlDependencyListener.cs (3)
45
private
SqlConnection
_con;
140
_escapedQueueName =
SqlConnection
.FixupDatabaseTransactionName(_queue); // Properly escape to prevent SQL Injection.
167
_sprocName =
SqlConnection
.FixupDatabaseTransactionName(SQL.SqlNotificationStoredProcedureDefault+"-"+guid);
fx\src\data\System\Data\SqlClient\SqlInfoMessageEventHandler.cs (2)
17
/// Represents the method that will handle the <see cref='System.Data.SqlClient.
SqlConnection
.InfoMessage'/> event of a <see cref='System.Data.SqlClient.
SqlConnection
'/>.
fx\src\data\System\Data\SqlClient\SqlInternalConnection.cs (7)
67
internal
SqlConnection
Connection {
69
return (
SqlConnection
)Owner;
208
SqlConnection
.ExecutePermission.Demand(); // MDAC 81476
250
SqlConnection
.ExecutePermission.Demand(); // MDAC 80961
596
SqlConnection
.VerifyExecutePermission();
678
static internal TdsParser GetBestEffortCleanupTarget(
SqlConnection
connection) {
716
var
connection = Connection;
fx\src\data\System\Data\SqlClient\SqlInternalConnectionSmi.cs (1)
44
SqlConnection
connection = _connection.Connection;
fx\src\data\System\Data\SqlClient\SqlInternalConnectionTds.cs (4)
670
database =
SqlConnection
.FixupDatabaseTransactionName(database);
1000
transactionName = " " +
SqlConnection
.FixupDatabaseTransactionName(transactionName);
2022
internal bool GetSessionAndReconnectIfNeeded(
SqlConnection
parent, int timeout = 0) {
2085
var
connection = Connection;
fx\src\data\System\Data\SqlClient\sqlinternaltransaction.cs (1)
335
using (SqlCommand transactionLevelCommand = new SqlCommand("set @out = @@trancount", (
SqlConnection
)(_innerConnection.Owner))) {
fx\src\data\System\Data\SqlClient\sqlmetadatafactory.cs (5)
42
private void addUDTsToDataTypesTable(DataTable dataTypesTable,
SqlConnection
connection , String ServerVersion) {
172
private void AddTVPsToDataTypesTable(DataTable dataTypesTable,
SqlConnection
connection , String ServerVersion) {
242
private DataTable GetDataTypesTable(
SqlConnection
connection){
264
SqlConnection
sqlConnection = (
SqlConnection
) connection;
fx\src\data\System\Data\SqlClient\SqlSecurityUtility.cs (5)
287
Debug.Assert(
SqlConnection
.ColumnEncryptionTrustedMasterKeyPaths != null,
298
if (
SqlConnection
.ColumnEncryptionTrustedMasterKeyPaths.TryGetValue(serverName, out trustedKeyPaths)) {
311
if (!
SqlConnection
.TryGetColumnEncryptionKeyStoreProvider(keyStoreName, out provider)) {
313
SqlConnection
.GetColumnEncryptionSystemKeyStoreProviders(),
314
SqlConnection
.GetColumnEncryptionCustomKeyStoreProviders());
fx\src\data\System\Data\SqlClient\SqlSymmetricKeyCache.cs (7)
62
Debug.Assert(
SqlConnection
.ColumnEncryptionTrustedMasterKeyPaths != null, @"SqlConnection.ColumnEncryptionTrustedMasterKeyPaths should not be null");
68
if (
SqlConnection
.ColumnEncryptionTrustedMasterKeyPaths.TryGetValue(serverName, out trustedKeyPaths)) {
80
if (!
SqlConnection
.TryGetColumnEncryptionKeyStoreProvider(keyInfo.keyStoreName, out provider)) {
82
SqlConnection
.GetColumnEncryptionSystemKeyStoreProviders(),
83
SqlConnection
.GetColumnEncryptionCustomKeyStoreProviders());
101
if (
SqlConnection
.ColumnEncryptionKeyCacheTtl != TimeSpan.Zero) {
104
DateTimeOffset expirationTime = DateTimeOffset.UtcNow.Add(
SqlConnection
.ColumnEncryptionKeyCacheTtl);
fx\src\data\System\Data\SqlClient\SqlTransaction.cs (7)
26
private
SqlConnection
_connection;
30
internal SqlTransaction(SqlInternalConnection internalConnection,
SqlConnection
con,
32
SqlConnection
.VerifyExecutePermission();
51
new public
SqlConnection
Connection { // MDAC 66655
115
SqlConnection
.ExecutePermission.Demand(); // MDAC 81476
277
SqlConnection
.ExecutePermission.Demand(); // MDAC 81476
332
SqlConnection
.ExecutePermission.Demand(); // MDAC 81476
fx\src\data\System\Data\SqlClient\SqlUtil.cs (1)
57
SqlConnection
connectionToAbort = null
fx\src\data\System\Data\SqlClient\TdsParser.cs (3)
1188
private void FireInfoMessageEvent(
SqlConnection
connection, TdsParserStateObject stateObj, SqlError error) {
1846
SqlConnection
connection = null;
1910
SqlConnection
connection = null;
System.Data.Entity (21)
System\Data\SqlClient\SqlProviderServices.cs (16)
219
SqlConnection
sqlConnection = SqlProviderUtilities.GetRequiredSqlConnection(connection);
722
SqlConnection
sqlConnection = SqlProviderUtilities.GetRequiredSqlConnection(connection);
741
SqlConnection
.ClearPool(sqlConnection);
785
private static void GetOrGenerateDatabaseNameAndGetFileNames(
SqlConnection
sqlConnection, out string databaseName, out string dataFileName, out string logFileName)
892
SqlConnection
sqlConnection = SqlProviderUtilities.GetRequiredSqlConnection(connection);
913
UsingConnection(sqlConnection, (
SqlConnection
con) => { });
944
private static bool CheckDatabaseExists(
SqlConnection
sqlConnection, int? commandTimeout, string databaseName)
975
SqlConnection
sqlConnection = SqlProviderUtilities.GetRequiredSqlConnection(connection);
1024
private static void DropDatabase(
SqlConnection
sqlConnection, int? commandTimeout, string databaseName)
1027
SqlConnection
.ClearPool(sqlConnection);
1042
private static SqlCommand CreateCommand(
SqlConnection
sqlConnection, string commandText, int? commandTimeout)
1058
private static void UsingConnection(
SqlConnection
sqlConnection, Action<
SqlConnection
> act)
1085
private static void UsingMasterConnection(
SqlConnection
sqlConnection, Action<
SqlConnection
> act)
1095
using (
var
masterConnection = new SqlConnection(connectionBuilder.ConnectionString))
System\Data\SqlClient\SqlProviderUtilities.cs (4)
29
internal static
SqlConnection
GetRequiredSqlConnection(DbConnection connection)
31
var
result = connection as
SqlConnection
;
34
throw EntityUtil.Argument(Strings.Mapping_Provider_WrongConnectionType(typeof(
SqlConnection
)));
System\Data\SqlClient\SqlVersion.cs (1)
51
internal static SqlVersion GetSqlVersion(
SqlConnection
connection)
System.Data.Linq (9)
SqlClient\SqlConnectionManager.cs (4)
156
SqlConnection
scon = this.connection as
SqlConnection
;
163
SqlConnection
scon = this.connection as
SqlConnection
;
SqlClient\SqlProvider.cs (5)
417
else if (con is
SqlConnection
) {
691
if (this.conManager.Connection is
SqlConnection
) {
692
SqlConnection
.ClearAllPools();
719
if (con is
SqlConnection
) {
720
SqlConnection
.ClearAllPools();
System.Web (47)
Cache\SqlCacheDependency.cs (6)
479
internal
SqlConnection
_sqlConn;
512
internal void GetConnection(out
SqlConnection
sqlConn, out SqlCommand sqlCmd) {
553
internal void ReleaseConnection(ref
SqlConnection
sqlConn, ref SqlCommand sqlCmd, bool error) {
755
SqlConnection
sqlConn = null;
1464
SqlConnection
sqlConnection = null;
1683
SqlConnection
sqlConn = null;
DataAccess\SqlConnectionHelper.cs (3)
262
SqlConnection
connection = new SqlConnection(connectionString);
282
internal
SqlConnection
_Connection;
285
internal
SqlConnection
Connection {
Management\SqlServices.cs (7)
373
SqlConnection
connection,
386
SqlConnection
connection,
553
static void EnsureDatabaseExists(string database,
SqlConnection
sqlConnection) {
583
SqlConnection
sqlConnection = null;
660
SqlConnection
sqlConnection = null;
722
static
SqlConnection
GetSqlConnection(string server, string user, string password,
724
SqlConnection
sqlConnection;
Management\SqlWebEventProvider.cs (1)
86
private void CheckSchemaVersion(
SqlConnection
connection) {
Profile\SqlProfileProvider.cs (1)
82
private void CheckSchemaVersion(
SqlConnection
connection )
Security\SQLMembershipProvider.cs (1)
216
private void CheckSchemaVersion(
SqlConnection
connection )
Security\SQLRoleProvider.cs (3)
85
private void CheckSchemaVersion(
SqlConnection
connection )
459
private void AddUsersToRolesCore(
SqlConnection
conn, string usernames, string roleNames)
571
private void RemoveUsersFromRolesCore(
SqlConnection
conn, string usernames, string roleNames)
State\sqlstateclientmanager.cs (9)
186
SqlConnection
dummyConnection;
391
internal static void ThrowSqlConnectionException(
SqlConnection
conn, Exception e) {
829
static bool CanRetry(SqlException ex,
SqlConnection
conn,
851
SqlConnection
.ClearPool(conn);
993
void GetServerSupportOptions(
SqlConnection
sqlConnection) {
1052
internal void InitSqlInfo(
SqlConnection
sqlConnection) {
1167
SqlConnection
_sqlConnection;
1248
SqlConnection
connection = _sqlConnection;
1528
internal
SqlConnection
Connection {
UI\WebParts\SqlPersonalizationProvider.cs (15)
75
SqlConnection
connection = null;
195
SqlConnection
connection = null;
287
SqlConnection
connection = null;
302
SqlConnection
connection = null;
378
SqlConnection
connection = null;
489
private void CheckSchemaVersion(
SqlConnection
connection )
503
private byte[] LoadPersonalizationBlob(
SqlConnection
connection, string path, string userName) {
550
SqlConnection
connection = null;
579
private void ResetPersonalizationState(
SqlConnection
connection, string path, string userName) {
606
SqlConnection
connection = null;
632
SqlConnection
connection = null;
684
SqlConnection
connection = null;
796
SqlConnection
connection = null;
905
private void SavePersonalizationState(
SqlConnection
connection, string path, string userName, byte[] state) {
933
SqlConnection
connection = null;
Util\SecUtil.cs (1)
241
internal static void CheckSchemaVersion(ProviderBase provider,
SqlConnection
connection, string[] features, string version, ref int schemaVersionCheck) {
System.Web.Extensions (1)
ClientServices\Providers\SqlHelper.cs (1)
70
if (!(conn is
SqlConnection
))
System.Workflow.Runtime (3)
Tracking\SqlTrackingQuery.cs (2)
154
private
SqlConnection
GetConnection()
161
SqlConnection
conn = new SqlConnection(_connectionString);
Tracking\SqlTrackingWorkflowInstance.cs (1)
815
using (
SqlConnection
conn = new SqlConnection(_connectionString))
System.WorkflowServices (6)
System\ServiceModel\Persistence\SqlPersistenceProviderFactory.cs (6)
388
SqlCommand CreateCommand(
SqlConnection
connection, TimeSpan timeout)
539
SqlConnection
OpenConnection(TimeSpan timeout)
542
SqlConnection
connection = new SqlConnection(GetConnectionString(timeout));
568
using (
SqlConnection
connection = new SqlConnection(GetConnectionString(timeout)))
610
using (
SqlConnection
connection = OpenConnection(timeoutHelper.RemainingTime()))
1047
SqlConnection
connection = this.provider.OpenConnection(timeoutHelper.RemainingTime());