SQL Azure Connection String

I started working with SQL Azure while having only minimal experience with SQL Server. Coming from an IT Pro background and not a developer, it took me a little while to find out how to convert a local database to a SQL Azure database. If you would like a developer take on SQL Azure, my colleague wrote a nice blog about it here. After establishing the database on the SQL Azure server, you need to edit the application’s connection string to point to the new database. To do this, you need to open app.config and change a few properties in the connection string. Before you begin, you need to know the SQL Azure Server Address. You can find this on the Server Administration page for SQL Azure: https://sql.azure.com .

• The first change is to replace the Data Source statement with a Server statement. The server address must be entered exactly as it appeared on the Server Administration page.

• Next, you need to replace the Initial Catalog statement with the Database statement. It is important to indicate which database you want to connect to, otherwise SQL Azure will assume the master database.

• The Integrated Security statement needs to be replaced by the User ID, Password, and Trusted_Connection statements. The user id value corresponds to user id created for use by the application. Trusted_Connection needs to have a value of False.

• Finally, MultipleActiveResultSets needs to have a value of False.

Share

Posted Friday, January 29th, 2010 at 4:17 pm by peterl
2,076 views

Comments are closed.