Search code examples
asp.netsql-server-2008enterprise-libraryazure-sql-database

Using SQL Azure in an existing connection setting


I have a database on SQL Server 2008. I have an ASP.NET application that uses the Enterprise Library to connect to the database. The configuration to connect to this database currently looks like the following:

<add name="DbConnectionString" connectionString="Server=serverName;Database=DatabaseName;Uid=user.name;Pwd=myPassword;" providerName="System.Data.SqlClient" />

This approach works. I want to move this database to SQL Azure. In the management portal, I have a connection string that looks like the following:

Server=tcp:serverName.database.windows.net,1433;Database=DatabaseName;User ID=user.name@serverName;Password=myPassword;Trusted_Connection=False;Encrypt=True;

How do I format the SQL Azure string so that I can put it in the connectionString value of my configuration setting?

Thank you!


Solution

  • My connection string is a format like:

    Password=MyPassword;Persist Security Info=True;User ID=MyUsername;Initial Catalog=MyDatabase;Data Source=n65hf24eep.database.windows.net