Playing with Azure and SQL Data Services: No "Random Access Paging"

So, I've started playing around with the whole Azure Services Platform (http://www.azure.com), now that school's done :) and I thought I'd blog about things I discover along the way.

My first idea was to create a simple blogging engine in MVC that would store data in SQL Data Services and run in Windows Azure (I got my invite code recently, yay!).  However, I soon discovered that would be difficult.  It turns out that while SQL Data Services does support "Paging" the results of a query so that you don't retrieve every result in one batch, it does not support what I refer to as "Random Access Paging".  Random Access Paging (and I'm sure theres some other term for it) basically means providing a page index and page size to the data layer and having it retrieve just that page (i.e. Skip/Take in LINQ).  There are some solutions, but most of them requrire that you step through each page sequentially, rather than just being able to request a page.

Of course, I may be missing something. So, if you know how I could solve this problem, feel free to post in the comments!

In a blogging engine, this is practically a necessity, since you only want to display a certain number of posts per page.  So I've tabled that idea for now.

My next idea: An RSS reader which stores your set of subscribed feeds in your Live Mesh (though I don't have access to that CTP yet).

Backing up a Zune Library for when you reinstall Windows

I regularly reinstall Windows, so when I used iTunes, I had to make sure I knew how to back up my music library (because I didn't want to re-rate all my songs :D).  I recently switched back to Zune from iTunes because I got so frustrated with my cracked iPod Touch screen.  Then, came the invevitable reinstall :)

I keep my music on a separate partition, along with ALL my data (Folder Redirection for the win!), so the music files aren't the problem.  With iTunes I could place the music library database on the other drive too, but so far no luck there with the Zune software (I'm going to check out Junctions to see if that will work).  So, I resigned myself to digging through my AppData folder to see if I could find the stuff I needed.

For those who don't already know, the AppData folder, in Windows Vista is in: C:\Users\[UserName]\AppData.  This is where programs (should) store their per-user settings and configuration data.  Unfortunately (AFAIK) it's not possible to redirect this folder (like you can with Documents, Music, etc.). 

The Zune software stores its settings in C:\Users\[UserName]\AppData\Local\Microsoft\Zune.  All I had to do was copy this folder over to my second partition, reinstall the OS and reinstall the Zune software.  Then, I started the Zune software, just to be sure and shut it down again.  I copied the backed up folder back into place, restarted the Zune software and voila my library is back.  I was even able to reconnect my Zune and have it automatically recognize it and sync!

So, in summary:
  1. Back up C:\Users\[UserName]\AppData\Local\Microsoft\Zune
  2. Reinstall Windows and other Apps
  3. Reinstall Zune
  4. Start Zune software (not sure if it's necessary, but it worked for me)
  5. Shutdown Zune software
  6. Copy backup back in to C:\Users\[UserName]\AppData\Local\Microsoft\Zune
  7. Start Zune software and enjoy!
Let me know if that works for you, or if you have problems!