A Lap around Dynamic Data

By jwmiller5 at December 08, 2009 22:12
Filed Under: Download, DynamicData, ASP.NET, Articles

ASP.NET Dynamic Data provides a framework that enables you to quickly build a functional data-driven application, based on a LINQ to SQL or Entity Framework data model. It also adds great flexibility and functionality to the DetailsView, FormView, GridView, and ListView controls in the form of smart validation and the ability to easily change the display of these controls using templates.

Here's a link to the presentation I gave for the Rockville .NET User's Group on Dec 9, 2009. We discussed the three enabling technologies and how we can use this tool from RAD to distributed enterprise development. I read all sorts of blogs to get the background information for this presentation and suggest you check out the list of links on delicious as well.

Migrating an ASP.NET Dynamic Data website to Windows Azure

By jwmiller5 at September 03, 2009 06:44
Filed Under: Cloud, DynamicData, ASP.NET, Azure, Articles

My previous post shows how to migrate a SQL database to Azure SQL. Now we will complete the app migration by migrating the web application to Windows Azure as well.

  1. We'll start by creating a "New Azure Web Cloud Service" in Visual Studio (2008 or 2010). You'll need to install the Windows Azure SDK to get this new project type. When this project starts up you'll have an Azure project, and a traditional web application.
  2. Follow the directions in this blog post to add an existing web application to the project.
  3. Edit the ServiceDefinition file by adding enableNativeCodeExecution="true" to the webRole element. This places the web worker role in full trust mode.
  4. Upload your project and service definition into a new Windows Azure project.
  5. Start your project, test it, and promote to Production.

Getting Started with SQL Azure

By jwmiller5 at August 30, 2009 20:27
Filed Under: Cloud, ASP.NET, Azure, Articles

I have a demo application that I have been using to test out new technologies including ASP.NET dynamic data websites as well as Windows Live Tools.

So now that I have an invite for Azure SQL I wanted to try these technologies out "in the cloud".

For this web application, I was going to try two different configurations

  1. App Local, DB in the cloud.
  2. App in the cloud, DB in the cloud. (more on this later)

The first step was to migrate the database from my local DB server to Azure SQL. The documentation to do this is available now. The only issues I ran into were

  1. No locking of any kind is supported (Page, Row-level) so all of those options need to be removed from the database
  2. Multiple Active Recordsets are not supported.

There are other limitations of SQL Azure currently. This is a demo app and is not using every last SQL Server feature, YMMV.

Once my scripts were scrubbed and ready to go, I opened up query analyzer and created my databases. A Select * brought back my tables. Wonderful!!!

One note about this, Don't use Debug. I repeatedly got the error "Unable to cast object of type 'System.DBNull' to type 'System.String'" trying to run query analyzer in debug mode. Just hit Execute and everything will run smoothly.

Next I changed the connection strings in my web.config to point to my new Azure SQL database. You can get your connection string by logging into your Azure management portal and choosing your database, there is an option to create connection strings for different data access providers. I ran the web application, and everything was working. I was able to create/edit/delete without any changes to my web application. Very nice.

To review, migrating a DynamicData website from SQL Server to Azure SQL involves

  1. Moving the database
  2. Changing your connection string