Demo: Using Entity Framework to Create and Query a SQL Azure Database In Less Than 10 Minutes - SQL Azure Team Blog - Site Home - MSDN Blogs

Demo: Using Entity Framework to Create and Query a SQL Azure Database In Less Than 10 Minutes

Demo: Using Entity Framework to Create and Query a SQL Azure Database In Less Than 10 Minutes

Rate This
  • Comments 9

As we were developing this week's posts on utilizing Entity Framework with SQL Azure we had an opportunity to sit down and talk with Faisal Mohamood, Senior Program Manager of the Entity Framework team. 

As we've shared in earlier posts this week, one of the beautiful things about EF is the Model First feature which lets developers visually create an entity model within Visual Studio.  The designer then creates the T-SQL to generate the database schema.  In fact, EF give developers the opportunity to create and query SQL Azure databases all within the Visual Studio environment and not have to write a line of T-SQL.

In the video below, I discuss some of the basics of Entity Framework (EF) with Mohamood and its benefits as the primary data access framework for .NET developers.

In the second video Faisal provides a real-time demonstration of Model First and creates a rudimentary SQL Azure database without writing any code.  Then we insert and query records utilizing Entity Framework, accomplishing all this in about ten minutes and ten lines of code.  To see all the details, click on "full screen" button in the lower right of the video player.  If you have a fast internet connection you should be able to see everything in full fidelity without pixelation.


Hopefully the videos in this post illustrate how easy it is to do database development in SQL Azure by utilizing Entity Framework.  Let us know what other topics you'd like us to explore in more depth.  And let us know if video content like this is interesting to you - drop a comment, or use the "Rate This" feature at the beginning of the post.

If you're interested in learning more, there are some outstanding walkthroughs and learning resources in MSDN, located here.

Make sure to check back, or subscribe to the RSS feed to be alerted as we post more information. Do you have questions, concerns, comments? Post them below and we will try to address them.

  • The second video does not seem to work for me for whatever reason.

  • Agree, 2nd video is broken.

  • that's odd - i checked it from my home connection and it appears to be working fine.  try this direct link to microsoft showcase:

  • Excellent Demo Steve & Mohamood,

    As a relative newcomer to entity framework (and SQL Azure), this looks to be quite useful.  Thanks for your concise and clear work!

  • Thanks guys but you really need to address the issue of connection retries using Entity Framework on SQL Azure otherwise EF4 is not usable in the real world for anything other than samples.  What do you tell clients when the connections are closed and they are getting errors every day?

    We've been waiting for your EF4 guidance on this as promised in September and all we have is the standard SQLConnection retry logic which is no use in EF.

    What's the update on this, what do we tell clients?  Stop using EF with SQL Azure?

  • Mike

    One of the patterns I suggest in my EF book is to wrap your query execution logic in a method that will capture errors and handle them. For example if you have a linq query, pass that to this more generialized method for execution and that method will handle an error including retrying queries if a connection error comes back. HEre is an msdn topic (thanks to Sergey Barskiy for teh pointer) with the error codes from SQL Azure:

  • Question still remains - are developers to expect internal support for SQL Azure retry logic within a future update of the Entity Framework (it is a framework), or are we to hack our own retry pattern around EF, or ADO.NET, or whatever is thrown at us for the time being, and then left to maintain that approach in the foreseeable future.

    There's a need for a stable, elegant, best-practices solution to address this issue - if EF is to be the ORM we're to leverage for SQL Azure connectivity.  Otherwise we're left writing ADO.NET DataReader logic around try/catch/finally blocks.

    We just need to know what to expect, when to expect it, and have someone step up with some guidance.  It's time.

    We love EF.  We love Code-First.  We love Azure.  We love the concept of SQL Azure, but if our investment in the tools, kits, sdks, concepts, practices, and the like, only leave us with problems and questions when deploying in the cloud, we'll look elsewhere - and that's a shame.

    Will EF CTP5 address this issue?  If not, we need an alternative.  Will EF 5.0 adress this issue?  If not, we need an alternative.  Is the SPX project the definitive approach on how to handle SQL Azure retry logic, even though it's using ADO.NET native instead of EF Code-First or otherwise?

  • No update from the SQL Azure guys on the retry problem that was asked in October. Please can you give us an update. Surely we don't have to wait until EF version 5. Thanks

  • Richard - surely you don't have to wait until EF version 5.  You have to wait for version 6! :(  This no where to be found in the EF 5 release notes.

Page 1 of 1 (9 items)
Leave a Comment
  • Please add 4 and 7 and type the answer here:
  • Post