Data Access
It is pretty rare to write an application without some type of data access. Topics in this track take a look at Entity Framework, LINQ and other data access technologies.
VLT4Implementing the Entity Framework in Existing Applications
Kevin McNeish
Tuesday, October 14 – 9:30 a.m.
Many .NET developers have existing .NET applications with an ADO.NET 2.0 data access layer. This session shows how you can best leverage Microsoft's Entity Framework without completely rewriting your data access layer or deeply impacting your existing applications.
VLT8Introduction to the Entity Data Model
Chris Franz
Tuesday, October 14 – 11:00 a.m.
ADO.NET 3.0 introduces the Entity Data Model (EDM) which is based on the Entity-Relationship data model. This session introduces you to this new data access method used in the next version of Visual Studio. We will discuss how to use the EDM in your future applications along with its features and benefits. The session will also include a discussion of integrating this new data access strategy into your existing ADO.NET applications.
VLT16Entity Data for Multiple Applications
Chris Franz
Tuesday, October 14 – 4:00 p.m.
One of the major strengths of the Entity Data Model (EDM) is it's ability to model data in many different ways. This is especially useful when the same data must be shared by several different applications which serve various business needs. The same tables can be represented differently for Sales and Technical support applications, for example. This session will focus on techniques for modeling data for various needs. A common database will be used as a foundation for creating several applications which serve different business needs.
VLW20Useful Evolution: Programming the New Features in SQL Server 2008
Leonard Lobel
Wednesday, October 15 – 4:45 p.m.
Get a jump start on the powerful new features in SQL Server 2008! In this information-packed session, we'll explore SQL Server 2008 and several of its most significant developer-oriented improvements and enhancements. Learn how to use table-valued parameters to marshal entire sets of rows across the network from client to server, and to pass them between stored procedures and UDFs. Find out about MERGE, a powerful new DML statement that combines the capabilities of four (or more) separate operations. Discover how to use the new hierarchyid data type to cast a hierarchical structure over any relational table. And with FILESTREAM, database developers can finally enjoy the native ability to store large binary objects in the file system transparently, and with full transactional capabilities. Lenni will walk through live demonstrations of all these features to get you ready for SQL Server 2008.
VLW12Queryable Data Services
Perry Birch
Wednesday, October 15 – 11:00 a.m.
Windows Communication Foundation provides a lot of great features such as configurable messaging channels and strongly typed data and service contracts to name a couple. What happens, though, when you really need rich query
capability against your data or you want to provide the data as a service and let the client decide what they need and how to get it? With ADO.Net Data Services you can turn your IQueryable data layer into a restful data service in a matter of minutes. In this session we will be building on the data layer built in the previous session, LINQing to Data, to create a simple tiered ASP.Net website and talk about where to go from there.
VLHWWorkshop: A Day of HANDS-On LINQ: What You Need to Know to Leverage LINQ, XLINQ and DLINQ with .NET 3.5 / C# 3.0
Richard Hale Shaw
Friday, October 17 –9:00 a.m.
LINQ is a technology – recently added to the .NET Framework – that will change your programming life. Just as Generics let us represent any type with <T>, LINQ lets you represent -- and manipulate any IEnumerable<T> -- regardless of what <T> is, and where it came from. Consequently, you can use elegant -- almost script-like -- programming techniques to transform, project and manipulate any sequence of objects in a type-safe fashion that's easy to understand and easy to maintain.
Unfortunately, it's the "Q" that makes LINQ difficult to comprehend: you hear "Query" and think, "it's only for Database developers." But LINQ is designed to work in any tier of an N-tiered application, and even lends itself to system-level programming.
So how does LINQ work? What goes on under-the-hood with LINQ, and can you leverage it in Silverlight front-ends, WCF services, Data Access Layers -- and of course -- Middle-tier business logic? In this 1-day HANDS- ON session, Richard will show you how.
We'll start by jumping right into building Linq queries: Selecting, Filtering, Ordering and Grouping. With these and more powerful queries (joining, sub-selects and data transformations), you'll quickly get the idea of how to use Linq using C# 3.0. We'll also discuss how Linq queries – based on the custom iterators introduced with C# 2.0 – leverage deferred execution so that you don't incur the overhead of query until you consume it. We'll also take a quick look at output options: how to emit query results as XML or output to a database.
Next, we'll look at the role of C# 3.0, and how the new features in 3.0 evolved from 2.0. You'll learn the new initialization techniques available, and how to "new up" anonymous types on-demand. We'll take a detailed look at extension methods and how they're both implicitly and explicitly used in Linq Queries, but also how you can use them in day-to-day .NET development. And we'll delve into Lambda Expressions, a new way of creating anonymous methods, but easier to read and write. We'll wrap up our C# 3.0 section with auto-implemented properties and partial methods.
The next section will let us explore how Linq is applied to real-world scenarios: querying and updating data from disparate sources like SQL databases, typed and untyped ADO.NET DataSets, and XML documents. We'll look at lots of fine details: how to use Linq to SQL (also known as DLinq) to query and update multiple tables; how to use Linq with existing typed/untyped DataSets – and when you should/shouldn't; how the VS2008 toolset will make so much of this child's play to get work done. We'll also examine Linq to XML, and you'll see how you can easily use it in place of – and along side of – existing code that accesses and updates XML documents. You'll see how you can quickly and easily serialize and de- serialize entire object graphs to and from XML documents cleanly – in a version-independent fashion – without the crud normally inserted by traditional .NET serialization.
Finally, we'll wrap-up with a behind-the-scenes look: what goes on when you create query expressions, how they work, and how .NET Framework 3.5 has been extended to include an entire sub-framework of methods and classes to support Linq. We'll also look at how you can build expressions and queries dynamically to address query needs only known at runtime.
Pre-requisites: you should have a minimum of 1 year experience programming C# 2.0 and .NET 2.0 (Sorry, no hand-holding if you're new to .NET/C#.) If you plan to participate in the hands-on labs, please bring a laptop with VS2008, and either SQL 2008 or SQL Express 2008 (comes with VS2008) installed.
VLT12Investigating LINQ to XML
Ken Getz
Tuesday, October 14 – 2:30 p.m.
LINQ adds many new features for Visual Studio 2008 developers, including strong support for working with XML data. In this session, you'll learn about working with XML data using LINQ, including creating, querying, modifying, and validating XML data, for both Visual Basic and C#. You'll also learn to use LINQ over XML to transform XML data (without using XSLT). Working with XML data could be a real pain before the addition of LINQ over XML, and this session gets you started using this powerful new technology.
VLW4Linqing to Data
Perry Birch
Wednesday, October 15 – 8:00 a.m.
Linq to SQL, Linq to Entities which do I chose? Both Object Relational Mappers stem from the LINQ Project, and provide run-time infrastructures for managing relational data as objects without giving up the ability to query. They accomplish this by translating language integrated queries into SQL for execution by the database and then translating the tabular results back into objects you define. Your application is then free to manipulate the objects while the engine stays in the background tracking your changes automatically. In this session we will look at how these features work from nuts to bolts as well as an overview some tools available by implementing a simple data access and business layer. In the follow-on session, Queryable Data Services, we will be building upon this stack to show a real world example of the service in use. The technology stack that will be used includes MS Sql, Linq and a bunch of C#.
VLW16LINQ Under-the-Hood: the Whys and Whens of Rolling-your-own LINQ Query Provider
Richard Hale Shaw
Wednesday, October 15 – 3:15 p.m.
Have you ever wondered how LINQ really works? How is a query statement built? How does the compiler know when to generate a SQL statement (if you're using LINQ to SQL), vs. a query of an XML document (if you're using LINQ to XML) vs. a query over objects in memory? And how do you LINQ-enable other data sources that aren't currently covered by LINQ, DLINQ or XLINQ? LINQ isn't magic: it relies on an API of static, extension methods that largely implement the Sequence Method Pattern: methods that take a sequence of objects (IEnumerable<T>), process them and return a result -- often a new IEnumerable<T>. Understanding this API, how it's implemented, how it differs from one query provider (such as DLINQ) to another (such as XLINQ) makes all the difference in how it behaves.
In this session, Richard will show you how the Standard Query Operator API works, how you can extend and intercept it, and how and when you can implement it in the form of a LINQ Query provider of your own. Along the way, we'll look at existing providers from sources outside of Microsoft, and why you may want to consider implementing your own. By the time we're finished, you'll have a clear understanding of how LINQ works.

