# Wednesday, June 16, 2010

The true power of OData is that the programming model is the same for any feed. I spend a lot of time building and demoing my own feeds- usually building an OData service around Northwind or AdventureWorks. To realize the power of OData you also need to know that you can consume public feeds. Let’s take a look at consuming the Microsoft TechEd Sessions OData Service. The TechEd service can be found here: http://odata.msteched.com/sessions.svc/

Being a RESTful service, we can drill down a little and investigate our data. I will do some URL querying and look at a list of all the speakers as well as their sessions. For example I can drill down to see all speakers named “Forte”

http://odata.msteched.com/sessions.svc/Speakers?$filter=SpeakerLastName eq 'Forte'

Or all of my sessions:

http://odata.msteched.com/sessions.svc/Speakers(1621)/Sessions

This is the beauty of OData, we don’t know how it was created, we also don’t care. All we care is if we can consume it easily. Let’s do so with an ASP.net application and the OData client for ASP.NET.

To get started, create a new ASP.NET application. In the application, right click on the References folder of the project in the Solution Explorer and select “Add Service Reference”. Put in the public URL of the TechED 2010 OData Service. This creates a proxy so you can code against the service locally and not know the difference.

image

Next set a reference to System.Data.Services.Client. This will enable us to use the OData client library and LINQ on the ASP.net client. Then drag a textbox, button, and a gridview to the ASP page. We’ll fill the gridView with the Speaker data filtered on the last name field based on what was typed in to the textbox. We accomplish this with the following code on the button click.

   1:  //set a reference to ServiceReference1 and System.Data.Services.Client
   2:  ODataTENA10Entities dat = 
   3:      new ODataTENA10Entities(new Uri("http://odata.msteched.com/sessions.svc/"));
   4:              
   5:  //LINQ statement to filter by the textbox
   6:  var result = from s in dat.Speakers
   7:                  where s.SpeakerLastName.StartsWith(TextBox1.Text.ToString())
   8:                  orderby s.SpeakerLastName
   9:                  select s; 
  10:   
  11:  //bind the results
  12:  GridView1.DataSource = result;
  13:  GridView1.DataBind();

 

Line 2 and 3 sets the data context and the LINQ statement is on lines 6-9. Line 7 is where we do the filtering based on the textbox. Pretty easy stuff.

image

Enjoy!

posted on Wednesday, June 16, 2010 7:19:13 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Tuesday, June 15, 2010

Last month I participated in a World Cup themed skit about information worker productivity at the launch of Office 2010 and SharePoint 2010 in Hong Kong. You can watch the skits here. It was a lot of fun and shows off a ton of new features in Office and Sharepoint, including PowerPivot.

Enjoy!

posted on Tuesday, June 15, 2010 4:56:51 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Monday, June 14, 2010

Last week at TechEd North America I did DEV303, Building RESTful Applications with the OData Protocol. I really enjoy doing this session since I get to code on the fly and talk about building applications. At a high level we covered:

  • What is REST, comparison to Web Services (REST is resource based, Web Services is RPC/method based)
  • What is OData, who is using it
  • When to use OData vs RIA Services (OData is for exposing data as a service across boundaries, RIA is for a VB6 style RAD application development)
  • Using WCF Data Services to build an OData Service
  • Consuming the WCF Data Service in Silverlight asynchronously –yes everyone had to suffer and watch me code
  • A Bill Gates joke
  • WCF Data Services Service Operations, Data Interceptors (Query and Change), Data paging
  • Consuming OData Services in ASP.NET (select and add, we even got to see my custom error raise)

You can download the slides and code here.

posted on Monday, June 14, 2010 8:25:55 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Thursday, June 10, 2010

Telerik won the “Best of TechEd” award in the “Best Components and Middleware” category last night at TechEd in New Orleans, LA. Our premium collection was judged as the most innovative and best value over all the other vendors.

All 200+ of the Telerik employees around the world feel honored and those of us here of course took time to celebrate on Bourbon street. Now we’re back to work and hope to live up to our customers high expectations. (If you are still at TechEd, swing by the booth and take a look at the award, we are here until 3pm today when the Expo closes.)

Thanks again to all of our customers, you make us better and we do it for you.

31691_1451994147381_1459091054_31166546_61564_n

Here are the Telerikers left standing late last night in the French Quarter in New Orleans.

posted on Thursday, June 10, 2010 12:34:20 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Tuesday, June 8, 2010

Thursday, June 17, 2010
10 Practices Every Developer Should Start Right Now

Subject: 
You must register at https://www.clicktoattend.com/invitation.aspx?code=149217 in order to be admitted to the building and attend.
Based on Caleb’s popular blog series, these are the 10 things that if you or your company starting doing today, it would drastically change the way that you write and deliver software!
Topics hit on: Object Oriented Principals, SOLID Coding, Security Concerns, Software Patterns, Automated Testing, Source Control - Branching and Merging Strategies, Continuous Integration, Agile | Scrum | XP | Lean, Team Dynamics, Continually Learning

Speaker: 
Caleb Jenkins, Proaction Mentors
As a long time community leader and former Microsoft Developer Evangelist Caleb is well known for his engaging speaking style, depth of knowledge and creative energy. Caleb is the Principal Mentor and founder of Proaction Mentors - a Software Architecture and Development Mentoring Company.
Working as a Microsoft Certified Solution Developer, Certified Trainer and .Net Architect Caleb has helped to design and implement enterprise .Net solutions for some of the largest companies in the world; Six Flags, Countrywide Mortgage, American Airlines, CGI-AMS, Dollar Thrifty Automotive Group and Sunoco Inc. to name a few.
You may also recognize Caleb from his previous work with Improving Enterprises, or from his work as an active national speaker for the International .NET Association (INETA), a Microsoft MVP for ASP.NET, a Certified Scrum Master. He’s worked as a technical editor for Wrox Press, and was recently a featured presenter on xTrain and Adobe.TV. Caleb is also the host, cameraman and editor for CommunityCast TV (CommunityCast.wordpress.com).

Date: 
Thursday, June 17, 2010

Time: 
Reception 6:00 PM , Program 6:30 PM

Location:  
Microsoft , 1290 Avenue of the Americas (the AXA building - bet. 51st/52nd Sts.) , 6th floor

Directions:
B/D/F/V to 47th-50th Sts./Rockefeller Ctr
1 to 50th St./Bway
N/R/W to 49th St./7th Ave.

posted on Tuesday, June 8, 2010 7:54:32 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Monday, June 7, 2010

Yesterday Joel and I did the day long Agile precon at TechEd in New Orleans, LA. We had a great crowd and were able to keep them engaged for 8 hours. You can download the materials here.

We used an “Agile presenting” technique where we put the agenda in an “Agenda Backlog” and we reprioritized after every sprint (agenda item) and let the audience decide what we would talk about next. To our surprise the audience voted against two planned sections and we did two new sections on the fly. We talked about:

  • Agile theory and agile methodologies (XP, Scrum, FDD, DSDM, *DD, Kanban, etc)
  • Intro to Scrum
  • Agile Estimation
  • Challenges to Implementing Agile in General
  • Challenges to Implementing Agile: In the Enterprise
  • Challenges to Implementing Agile: Remote Teams
  • Tools
  • QA and Documentation

We got into a discussion on what happens when the team finishes early, do you stop the sprint, or give them more work to do. (Joel and I both go against the agile literature and give the team more work!)

We also took a few micro-breaks to rest our brain to talk about the iPhone v Android, how I buy Joel clothes, and movie quotes from the Matrix (I know Kung Fu) and What about Bob (Baby Steps).

We also recommended a book, one of my favorite management books of all time: Peopleware. For those of you non-techies reading this blog (I don’t know why!) if you manage teams, this book is also for you.

Hope to do this seminar again soon!

posted on Monday, June 7, 2010 12:04:51 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [1] Trackback
# Friday, June 4, 2010

While connecting flights in Japan today en route to TechEd, the security wanted to re-run my bag. They kinda freaked out as to what was in it. They took everything out that was electronic and ran it again. The electronics took three bins, here is what it was:

  • Dell laptop
  • Laptop plug
  • Adapter (my plug uses Hong Kong prongs)
  • Cat5 wire
  • USB external hard drive
  • Wireless mouse
  • Kindle
  • Kindle wire
  • Bose noise cancellation headphones
  • Zune
  • Zune wire
  • Canon G10 Camera
  • Camera battery charger
  • Camera wire
  • Android Nexus One Phone
  • Charger

By now the only thing left in the bag was my notebook, business cards, a pen, and my passport. I would have taken a photo but they had my camera!

posted on Friday, June 4, 2010 6:31:17 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [1] Trackback
# Thursday, June 3, 2010

Last week Telerik released a service pack for OpenAccess Q1. The service pack fixes a few issues with Telerik’s new LINQ implementation working under Visual Studio 2010. In addition, the service pack shipped the Data Services Wizard; the Data Service Wizard is no longer a separate install. You can use the Data Service Wizard with traditional OpenAccess classes or the new LINQ implementation. Today I will show show you a new feature of the wizard: automatically creating a styled Silverlight application from your domain model. Future blog posts will show how to use RIA Services as well as SQL Azure.

To get started open up Visual Studio 2010 and create a new ASP.net application. Create a new domain model by right clicking on the project and say Add|New Item and choose Telerik OpenAccess Domain Model from the dialog.

image

This will bring up the OpenAccess ORM Data Wizard to create your domain model by mapping tables to entities. Let’s use Northwind and map all tables and use the default model name: NorthwindEntityDiagrams. While there are other advanced features of the wizard, like T4 templates to override the default codegen, let’s just accept the defaults and finish.

image

Once you click Finish the wizard will add a new domain model to your project.

image

Now that we have our domain model, it is time to run the Data Services Wizard to automatically create the a RESTful service using WCF Data Services. (The data service wizard also gives us the ability to create a WCF endpoint as well.) This can be done from the Telerik|Data Services Wizard menu option from the Visual Studio main menu (or right clicking on the EntityDiagrams1.rlinq file.) The first page of the wizard asks you where the domain model lives and what project to place the new service in. We’ll do it all in the same project.

image

The next page of the wizard asks you what entities you want to expose in your service as well as if you want to generate a Silverlight Application. If you check this you are given the option to use the standard Microsoft Silverlight controls or the Telerik controls (if you have them installed.) If you choose the Telerik controls, you will also be able to choose a theme for your Silverlight application. The drop down will show you a list of all of the installed themes. I’ll go ahead and choose the Windows7 theme.

image

After you click through the finish page of the wizard, the next step is to hit F5 and run your application. A basic, but styled, Silverlight application is created for you, getting you started with all of the CRUD methods. The Telerik version has all of the features your would expect, built in sorting and filtering, grouping, etc. I know that you will want to change the baseline application, but this is a great start, eliminating all of the asynchronous CRUD code that you have to write. Not bad for about 30 seconds of work!

image

Enjoy!

posted on Thursday, June 3, 2010 3:41:03 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Wednesday, June 2, 2010

I found this over on Jeff Atwood's blog today. Jeff was explaining issues around the Stack Exchange on Stack Overflow and spoke about what motivates employees. What is interesting is that money was not the top item on the list. Jeff was influenced by Dan Pink of the RSA org’s TED talk and other works. 

The notion that money motivates employees comes from classical economics study of the Industrial Revolution. Back then people did tasks and built widgets, the more tasks they did, the more widgets they built, the more profit the company made. Today most people work in a knowledge economy. Dan Pink makes the argument that once someone have to use their brain at work, money is less and less of a motivator. I am republishing Dan’s video from YouTube about the “Surprising truth about what motivates us.” Worth watching.

 

posted on Wednesday, June 2, 2010 4:29:37 AM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback
# Tuesday, June 1, 2010

I’ll be speaking at TechEd North America in New Orleans next week and hope to have a front row seat to some Microsoft announcements. Microsoft practices CDD or “Conference Driven Development” where major announcements have been made only at large trade shows like PDC, MIX, and TechEd. Since there is no PDC this year, TechEd is an opportunity for Microsoft to make some BI, developer or IT pro announcements. There are two keynotes by “Microsoft executives” and I’ll be looking (hoping) for Microsoft to make the following announcements, in order of probability:

iPhone Development Kit

This one has been rumored for a while. While I am sure we may see some kind of minor Windows Phone 7 announcement at Teched, is there going to be an iPhone SDK for Silverlight and Visual Studio 2010?

Azure Pricing Changes

Windows Azure seems to have been accepted by the Tech community as something that is well architected and very stable, but the general consensus is that it is a tough sell to customers privacy/cloud wise and cost wise. While I don’t have a major problem with Azure pricing, it could have more competitive pricing plans in place in order to do a land grab on adoption.

Silverlight 5.0 Roadmap

It is too early for a beta, but it would be great to have some info on Silverlight 5.0, what it will support, what it will look like, etc. Microsoft has been so quick to ship new iterations of Silverlight that people expect the same out of Silverlight 5.0. For example, Silverlight 2.0 shipped in October 2008 and Silverlight 3.0 beta appeared in March 2009, only 5 months later. Silverlight 3.0 shipped in July 2009 and Silverlight 4.0 beta 1 shipped in November 2009, only 4 months later. Silverlight 4.0 shipped in April 2010, so June 2010 is a reasonable timeframe for Microsoft to talk about Silverlight 5.0 features and design goals, if not a beta timetable.

Windows 8 Sneak Peek

OK I admit it, I love Win7 and have zero complaints or don’t even have a wish list for Win8. But it is the geek inside of me that wants a sneak peek of Win8. I am pretty sure that this will not happen, but Vista shipped in January 2007 and we had an alpha in October 2008, so not unheard of. I don’t need an alpha, just a sneak peek.

SQL Server 2012 Info

Ok, if it too soon to talk about Silverlight and Windows, then why not SQL Server 2012? TechEd is more of an IT Pro conference and it is co-located with the BI Conference, so maybe, just maybe we will get some info on SQL.next.

Steve Ballmer’s Retirement

Don’t laugh. At TechEd in Boston in 2006 it was announced that Bill Gates was retiring. Steve has been in charge a long time, while I don’t expect a leadership transition at this point in time, you never know.

Free Windows 7 Phone

Hey, Google gave out new Android phones at I/O twice. Microsoft gave us all a tablet at the PDC. Why not a phone?

posted on Tuesday, June 1, 2010 10:52:51 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] Trackback