| By Kevin Hoffman | Article Rating: |
|
| October 31, 2009 06:00 PM EDT | Reads: |
965 |
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 965
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.
- Yahoo! to Present at 4th International Cloud Computing Expo
- Windows 7 – Microsoft’s First Step to the Cloud
- Visual Studio 2010 Is Cloud Friendly
- Jill T. Singer of CIA to Present at Cloud Computing Expo on November 2
- Adobe Flex Developer Earns $100K in New York City
- Microsoft Falls Off Cliff, Keeps on Ticking
- SplendidCRM for Microsoft Windows Azure
- New Version of TuneUp Utilities Available in Late October
- ASP.NET Membership Provider in the Cloud
- Microsoft to Data-Mine Facebook & Twitter
- Binary Serialization and Azure Web Applications
- Amazon RDS vs. SQL Azure
- The Difference Between Web Hosting and Cloud Computing
- Yahoo! to Present at 4th International Cloud Computing Expo
- Eval JavaScript in a Global Context
- Windows 7 – Microsoft’s First Step to the Cloud
- Social Media on Ulitzer - Strategy Nets New AUM for RIA
- EC Wrong, Wrong, Wrong – and Sloppy to Boot: Intel
- This Bing Thing Is Working
- Microsoft Expression Web Has Got Game
- Visual Studio 2010 Is Cloud Friendly
- Kaazing Adds Networking Industry Executive and Startup Veteran
- Jill T. Singer of CIA to Present at Cloud Computing Expo on November 2
- Silverlight Polling Duplex Channel is NOT a Scalable Solution
- Where Are RIA Technologies Headed in 2008?
- The Top 250 Players in the Cloud Computing Ecosystem
- Accessing the ASP.NET Authentication, Profile and Role Service in Silverlight
- Silverlight 2 - Adobe Flex Killer Is on Its Way!
- Building Great AJAX Applications Using ASP.NET
- Spice Up User Experience with Silverlight
- Is the Silverlight Adoption Rate Artificially Inflated?
- Kaazing Announces Support for Silverlight
- Will Google's Android Sink or Swim?
- VS 2008 Builds AJAX-based Web Apps
- Rich Content Rotator for ASP.NET
- Getting Started with Silverlight: Zero to Hero




































