Toolbox - Data Integration Tools and Resources
By Terrence Dorsey | March 2011
It seems that all but the most trivial applications these days deal with data. Often, lots of data. So I guess that means, as a developer, you need to add “Database Expert” to the many hats you wear. Or maybe not: What if there were tools and resources out there that gave you a leg up and did some of the heavy lifting for you?
A good place to start is the MSDN Data Developer Center (msdn.microsoft.com/data), where you’ll find links to a huge selection of Microsoft tools and technologies for integrating data access into your apps. From SQL Server to ADO.NET to MSXML, you’ll find it all there.
In fact, it’s such a comprehensive resource I probably could leave it at that. Happy databinding!
But wait! There’s more ...
What’s that? You’re not already savvy in the ways of SQL Server? Tables, rows and records sounds more like party planning than dev speak? If you’re just getting started with data-centric development—or need a refresher—here are a few resources that will get you up to speed.
Geekgirl’s Plain-English Computing database guides (geekgirls.com/category/office/databases) provide a series of “Databasics” tutorials explaining the core concepts of database design and use. If you’re starting from scratch, you can’t do much better than this.
Once you understand those basics, a solid next step would be something like the Code Project article “SQL for Developers: Basic Data Retrieval” (bit.ly/gurX8Y). Here you’ll learn how to use simple SQL queries to get selected data out of a database and into your app, where you can do something useful with it. (That task is left to the reader ... but read on for some tips.)
For a deeper look at the syntax for communicating with a database engine like SQL Server 2008, check out the Transact-SQL Reference (bit.ly/hDhdvz) in SQL Server Books Online.
Once you get coding, you’ll want to check frequently for tips and tricks at SQL for Programmers, the .NET Answers archive of SQL programming tips (bit.ly/ejD7Zg).
Language Integrated Query (LINQ) is a feature of the Microsoft .NET Framework that extends data access using native language constructs in C# and Visual Basic (and F# to some extent, as well). Learn more about it at the LINQ Developer Center (bit.ly/fl9xpg).
One of the strengths of LINQ is that it enables you to write SQL-like queries using strongly typed syntax. Then, LINQ providers such as LINQ to SQL or LINQ to Objects can handle the fine details of the actual data source. For a practical overview of how this works, see the Data Points column by John Papa, “Standard Query Operators with LINQ” (bit.ly/huKhxa).
LINQPad (linqpad.net) has become a crucial tool for developers to learn LINQ, prototype queries, or interactively query a wide variety of data sources. LINQPad is a free tool written by Joseph Albahari (albahari.com) and supported by a huge community of programmers and data experts.
If you’re just getting started with LINQ, check out Dan Wahlin’s blog post, “Learn How to Use LINQ with LINQPad” (bit.ly/hlOyMh), and Al Tenhundfeld’s article, “Master LINQ with LINQPad” (bit.ly/fSUij4). Both will get you up and running quickly.
Not only is LINQPad a great tool for LINQ queries, it also lets you interactively run and verify functions in C# and Visual Basic. Rich Strahl demonstrates this handy feature in his article, “LINQPad as a Code Snippet Execution Engine” (bit.ly/eCD60C).
The ADO.NET Entity Framework is a .NET object-relational mapping (O/RM) framework meant to simplify access to relational databases from your code. Simply stated, the Entity Framworok lets you map your database schema to programmatic entities that you can query via properties. To learn more about the Entity Framework, see the ADO.NET Entity Framework Developer Center(bit.ly/eOmtC1).
If you’re new to the Entity Framework, get up to speed by working through the Microsoft “Getting Started with Entity Framework” tutorials (bit.ly/gcrXyU) for WebForms. If you prefer to use ASP.NET MVC, there’s also a “CreatingModel Classes with the Entity Framework” tutorial (bit.ly/dXJAjx).
Julie Lerman, our regular Data Points columnist, is an Entity Framework expert, having written the comprehensive “Programming Entity Framework, Second Edition” (O’Reilly, 2010). Learn more about her book at learnentityframework.com. Want to get a taste of some advanced tasks you can achieve with the Entity Framework? Read Lerman’s December 2010 column, “Profiling Database Activity in the Entity Framework” (bit.ly/flLwdw).
Julie Lerman’s Book
Of course, LINQPad is a great tool for learning the Entity Framework, too. Check out “Using LINQPad with Entity Framework,” (bit.ly/hUBRu0) for a full tutorial.
WCF Data Services and OData
WCF Data Services—formerly known as ADO.NET Data Services—lets you share, consume and update data via HTTP using the OData protocol (odata.org). Like the Entity Framework, WCF Data Services uses an Entity Data Model (EDM) to bridge between data source and program entities. You can read more about WCF Data Services on MSDN at bit.ly/hnuvwv.
To get you started, Shayne Burgess walks you through the basics of using OData and Data Services in the article, “Building Rich Internet Apps with the Open Data Protocol,” in the June 2010 issue of MSDN Magazine (bit.ly/gPZGDc).
Not sure which WCF services to use for your data-centric app? Tony Sneed wrote an in-depth appraisal of WCF Data Services vs. WCF Soap Services (bit.ly/icbLnR) that will help you understand the strengths of each approach.
How about putting a bunch of these technologies together into one interesting sample? Shawn Wildermuth, in his article “WCF Data Services and jQuery” (bit.ly/hVCMWd), builds a Web app that uses jQuery to retrieve data in JSON format, exposes the data as entities via Entity Framework, and then uses WCF Data Services to expose the entities via REST. I think we have a “Buzzword Bingo” winner here.
A highly rated tool for making sense of your data sources is the Open Data Protocol Visualizer extension for Visual Studio 2010 (bit.ly/dWt19X), which displays the types and relationships provided by WCF Data Services in simplified diagram form. Read Audrey Petit’s “Open Data Protocol Visualizer Extension for Visual Studio 2010” blog post (bit.ly/hKSKRx) to learn how it works.
Open Data Protocol Visualizer
NHibernate (nhforge.org) is an open source O/RM framework for development with the .NET Framework. Like the Entity Framework, NHibernate lets you map databases to entities and allows simplified programmatic access to the data.
Because it’s a community-driven effort, there are lots of useful resources available for learning and using NHibernate in your projects. One great way is to jump in and start coding. Gabriel Schenker’s “Your Very First NHibernate Application” series of articles on dotnetslackers.com (direct link: bit.ly/exFATb) is one such tutorial. Another is Mitch Fincher’s “Learning with Code Samples” for NHibernate (bit.ly/e91Nzv).
Would you rather see the movie? Well then, check out the Summer of NHibernate (summerofnhibernate.com) screencast series, which walks you step-by-step from getting set up to writing your first queries to advanced topics like modeling inheritance and managing session state. There’s a lot to watch, so get your popcorn ready and settle in for a few evenings of learning.
Many business and social apps run on data, but researchers are increasingly creating and sorting through huge data sources from clinical studies, experimental results and even celestial observations. In response, Microsoft Research released Zentity 2.0 (bit.ly/fiFPb3), a data library framework that can be used for storing, accessing and analyzing data using SQL Server 2008. The new version of Zentity leverages the .NET Framework 4 with support for WCF Data Services and OData, LINQ, Entity Framework, Windows PowerShell and more.
Terrence Dorsey is the technical editor of MSDN Magazine. You can read his blog at terrencedorsey.com or follow him on Twitter: @tpdorsey.