Stop playing with the LightSwitch

25 Aug

If you’ll excuse me for a moment, I just got the sudden urge to totally geek out. Oh, who am I kidding? Here’s my latest techno-nerd-babble:

(FYI: It’s not a groove, it’s not slightly transformed, but it is a bit of a break from the norm.)

Yesterday I installed the new Visual Studio LightSwitch (Beta 1) app. After playing with some samples, I tried to create a simple app that calls an external web service and displays the data. I read somewhere that this isn’t possible unless you first call a WCF RIA Service, which could itself call the external service and send the result back to LightSwitch. Kind of like driving from Kansas City to St. Louis to get to Denver.

So, I added a WCF RIA Services project to the solution. To this project I added a service reference to a free web service I found which takes a given year and returns the date Black Friday took place that year. Delightful! And almost completely useless. But hey, it’s free.

I created a service method in my RIA service that simply calls the external service five times with five different dates. I wanted multiple results so I could return an IEnumerable<T> back to the UI. Next, I went through LightSwitch’s Add Data Source wizard and chose “WCF RIA Service”. After waiting an eternity (they take the word “Beta” very, very seriously at Microsoft), I was finally able to complete the wizard and add a reference to my RIA service.

Finally, I added a simple screen to display the data in a grid when the app loads. I hit F5 and…hey, it worked! That was both fun and educational. Maybe I’ll post screenshots if I get something interesting built with the production version of the tool. In the meantime, I better quit playing with the LightSwitch before I start a fire.

Right…like THAT’S really gonna happen, Dad.

Advertisements

One Response to “Stop playing with the LightSwitch”

  1. jhered March 14, 2011 at 9:53 pm #

    at least you didn’t play with what this guy did:

    “It only took a few hours of playing with Self to lead to fruitless right clicking on the iPhone simulator. http://bit.ly/HzQta Mind warping.”

    http://twitter.com/rippleinc 2:50 AM Feb 12th via web

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: