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