| By Kevin Hoffman | Article Rating: |
|
| October 31, 2009 06:00 PM EDT | Reads: |
1,767 |
As mentioned in my previous blog post, you don't get full designer support on SQL Azure within SQL Server Management Studio. In addition, you don't get designer support for LINQ to SQL or Entity Framework, either. So what do you do if you want to take advantage of these awesome object mapping tools but the designers don't work directly against the cloud?
Conveniently enough, if you follow the tips in the previous blog post, you would have already created a local copy of your SQL Azure database. The "trick" (not really a trick at all, just not immediately obvious) is to point your EF or LINQ to SQL Visual Studio projects at your local database. This will give these mappers the schema and relationship information they need in order to create the appropriate conceptual<->relational mappings.
For LINQ to SQL, all you need to do is replace the connection string that it adds to your app.Config file with the connection string supplied by the sql.azure.com portal. Remember to include your password in this connection string because the portal copies a version of this string to your clipboard with the password of myPassword. At this point you should also be thinking to yourself, "Wow, I just put a cleartext password in a .config file. It's a really good thing that this code isn't going to sit on someone's desktop and will be protected in the cloud."
With Entity Framework, the connection string is a little more complicated. There's some entity stuff in there that points to the various model definition files in the project and then there's an embedded connection string. Replace the embedded connection string (take care to maintain the escaping of nested quotes, etc) with the one the SQL Azure portal supplied and change the password to reflect the right password.
At this point you should have been able to generate a model from your local database and then change the connection string so that the actual data comes from the cloud database. It might seem a little inconvenient but it isn't really all that bad. It just adds a few extra steps to your SDLC when you need to change the schema of a live application.
The feeling I got when I ran my first LINQ to Entities query against a cloud-based SQL Server database was overwhelming. Sure I love new technology as much as the next guy, but the possibilities that are being opened for developers by Windows Azure and cloud computing in general are so numerous it's hard to contain myself.
This is a damn good time to be a developer.
Read the original blog entry...
Published October 31, 2009 Reads 1,767
Copyright © 2009 Ulitzer, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Kevin Hoffman
Kevin Hoffman, editor-in-chief of SYS-CON's iPhone Developer's Journal, has been programming since he was 10 and has written everything from DOS shareware to n-tier, enterprise web applications in VB, C++, Delphi, and C. Hoffman is coauthor of Professional .NET Framework (Wrox Press) and co-author with Robert Foster of Microsoft SharePoint 2007 Development Unleashed. He authors The .NET Addict's Blog at .NET Developer's Journal.
- Cloud Economics – Amazon, Microsoft, Google Compared
- Azure Gets its First Commercial ERP App
- Appirio Predicted Windows Azure Disappointment in 2009
- The Cloud Storage Wars: Windows Azure vs. Google
- Cloud Computing on Windows Azure
- RightScale To Support Azure
- Microsoft Forms Server and Cloud Computing Division
- Microsoft Predicts Azure Success
- Why Back Up Google Docs To Windows Azure Storage?
- Microsoft Azure Will Cannibalize a Global Account -Appirio
- GoGrid Cloud Computing Achievements of 2009
- Microsoft Brings Cloud Interoperability Down to Earth
- Cloud Expo New York Call for Papers Now Open
- Cloud Economics – Amazon, Microsoft, Google Compared
- Azure Gets its First Commercial ERP App
- Daddy, Where Did Windows 7 Come From?
- Appirio Predicted Windows Azure Disappointment in 2009
- The Cloud Storage Wars: Windows Azure vs. Google
- Cloud Computing on Windows Azure
- Installing Geneva Beta 2 on Windows 7
- RightScale To Support Azure
- Ecosystem For Cloud Computing Adoption
- Microsoft Forms Server and Cloud Computing Division
- SugarCRM on Windows Azure Cloud Computing Platform
- The Top 250 Players in the Cloud Computing Ecosystem
- The Future of Cloud Computing
- Ray Ozzie: Who Can Keep Microsoft From "Growing Old Inside"?
- Cloud Expo New York Call for Papers Now Open
- Amazon, Google, Microsoft - Big Three Cloud Providers Examined
- SYS-CON's 1st International Cloud Computing Conference & Expo: Show Report
- Building a Composite Application Using Multiple Web Services
- Windows 7 To Virtualize XP
- Review of 2008: A Developer's Perspective
- Microsoft’s Mike Neil Keynotes at SYS-CON's 4th International Virtualization Conference & Expo
- The Past, Present and Future of The Cloud
- Cloud Computing Is Far More Than Just Cutting Enterprise IT Costs























Ulitzer content is offered under Creative Commons "Attribution Non-Commercial No Derivatives" License.
For any reuse or distribution, you must make clear to others the license terms of this work.
The best way to do this is with a link to this web page.
Any of the above conditions can be waived if you get written permission from Ulitzer, Inc., the copyright holder.
Nothing in this license impairs or restricts the author's moral rights.