Putting It All Together

I wanted the examples in the previous chapter to be easy for someone trying to learn how to query with the LINQ to DataSet API. I wanted the time you spend working with any examples to be focused on LINQ. I didn't want you to have to struggle with getting a database or getting your connection string correct. But, before we leave this chapter, I want to provide a more complete example—one that is actually getting a DataSet from a database because this is most likely how you will obtain a DataSet in your real-life code.

I must admit that creating a reasonable-size example that gets data from a database and uses the LINQ to DataSet API to any degree feels very contrived. After all, I am going to perform a SQL query on data ...

Get Pro LINQ: Language Integrated Query in C# 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.