Show / Hide Table of Contents

# Class SqlConnectionFactory

Factory class to create SqlClientConnections The purpose of the factory is to make it easier to mock out the database in 'offline' unit test scenarios.

##### Inheritance

System.Object
SqlConnectionFactory

##### Inherited Members

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)
System.Object.ToString()

###### Namespace:Microsoft.SqlTools.ServiceLayer.Connection

###### Assembly:Microsoft.SqlTools.ServiceLayer.dll

##### Syntax

    public class SqlConnectionFactory : ISqlConnectionFactory

### Methods

| Improve this Doc View Source

#### CreateSqlConnection(String)

Creates a new SqlConnection object

##### Declaration

    public DbConnection CreateSqlConnection(string connectionString)

##### Parameters

Type | Name | Description
--- | --- | ---
System.String | connectionString |

##### Returns

Type | Description
--- | ---
System.Data.Common.DbConnection |

##### Implements

ISqlConnectionFactory.CreateSqlConnection(String)