Skip to main content

Creating a New Connection

In BimlStudio, connections are defined once in a project and shared with all the objects that need to reference them. This allows you to easily update connections in a single location.

Create a new connection

  1. Go to the Home tab on the ribbon, and click the Connection button. The Connection button is a split button. Clicking the top half will create a new OLE DB connection, and clicking the bottom half will list all the available connection types.

    Connection Button

  2. Click the OLE DB menu item to create an OLE DB Connection. When the connection is created, it will appear in the Logical View under Connections.

    Logical View

  3. The connection designer should be open on the right, if not Double-click on the connection to open the designer for it.

  4. OLE DB connections require that you provide a connection string. For this example, you can copy, paste and edit the following connection string:

    Provider=MSOLEDBSQL;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=AdventureWorksLT;

    Note: The recommended OLE DB provider is MSOLEDBSQL (Microsoft OLE DB Driver for SQL Server). The older SQLNCLI11 provider is deprecated and should not be used for new projects.

  5. You can use the connection builder by following these steps:

    • Select a Provider - Choose MSOLEDBSQL for SQL Server connections
    • Specify a Server - Enter your SQL Server instance name
    • Choose an Authentication method - Windows Authentication or SQL Server Authentication
    • Specify a Database name or click the Update link to get a list of available databases

    Connection Designer

  6. Change the Name value from OleDbConnection1 to AdventureWorksLT to give the connection a meaningful name. You will be prompted "Do you also want to rename the asset's Biml file?" click Yes

    Finished Connection Designer

  7. Save the project to persist your changes to the project files. See Saving a Project for more information.

  8. Once you've entered a connection string, you can click the Test button in the Connection Tools. Connections tab in order to validate it.

The connection string in the example above allows you to connect to the AdventureWorksLT database running on your local computer, using your Windows credentials. You will need to alter the connection string if you are using another server or a different authentication method.

Connection Providers

ProviderDescriptionUse Case
MSOLEDBSQLMicrosoft OLE DB Driver for SQL ServerRecommended for SQL Server
MSOLEDBSQL19Microsoft OLE DB Driver 19Latest version with enhanced security
SQLNCLI11SQL Server Native Client 11Legacy (deprecated)

For cloud database connections, see the Cloud Connections guide.

View Biml

If you right click the connection and click View Biml it should look similar to the following snippet.

<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<Connections>
<OleDbConnection Name="AdventureWorksLT" ConnectionString="Provider=MSOLEDBSQL;Data Source=localhost;Integrated Security=SSPI;Initial Catalog=AdventureWorksLT" />
</Connections>
</Biml>