| By Kevin Hoffman | Article Rating: |
|
| October 31, 2009 06:00 PM EDT | Reads: |
8,376 |
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 8,376
Copyright © 2009 SYS-CON Media, 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.
- Improving the Mobile Experience with HTML5
- Five Questions to Ask Before You Take Up an Agile Contract
- Any Means Possible: Tales from Penetration Testing
- Dome9 Security Addresses RDP Cloud Server Vulnerability
- Cloud Office and Collaboration Productivity Applications Market Shares, Strategies, and Forecasts, Worldwide, 2012 to 2018
- What Windows 8 Hyper-V R3 Storage Enhancements Will Mean
- Facebook Buys $550M Worth of AOL Patents Off Microsoft
- Book Review: Microsoft SQL Server 2012 Reporting Services
- Microsoft Gets Out of Dodge Ahead of the Sheriff
- dynaTrace AJAX Edition 3.6 Now Supports Firefox 11
- Windows for ARM Will Be Windows RT
- Book Review: Microsoft SQL Server 2012 - A Beginner's Guide
- Improving the Mobile Experience with HTML5
- Five Questions to Ask Before You Take Up an Agile Contract
- Any Means Possible: Tales from Penetration Testing
- Dome9 Security Addresses RDP Cloud Server Vulnerability
- Cloud Office and Collaboration Productivity Applications Market Shares, Strategies, and Forecasts, Worldwide, 2012 to 2018
- What Windows 8 Hyper-V R3 Storage Enhancements Will Mean
- Book Review: Pro .NET Best Practices
- Facebook Buys $550M Worth of AOL Patents Off Microsoft
- Book Review: SharePoint Designer 2010 Unleashed
- Book Review: Microsoft SQL Server 2012 Reporting Services
- Microsoft Gets Out of Dodge Ahead of the Sheriff
- dynaTrace AJAX Edition 3.6 Now Supports Firefox 11
- Where Are RIA Technologies Headed in 2008?
- Accessing the ASP.NET Authentication, Profile and Role Service in Silverlight
- Building Great AJAX Applications Using ASP.NET
- The Top 250 Players in the Cloud Computing Ecosystem
- Silverlight 2 - Adobe Flex Killer Is on Its Way!
- Spice Up User Experience with Silverlight
- Is the Silverlight Adoption Rate Artificially Inflated?
- Will Google's Android Sink or Swim?
- The Next Chapter in the Virtualization Story Begins
- Kaazing Announces Support for Silverlight
- Cloud Expo 2011 East To Attract 10,000 Delegates and 200 Exhibitors
- Rich Content Rotator for ASP.NET




















