Showing posts with label Katmai. Show all posts
Showing posts with label Katmai. Show all posts

Saturday, April 12, 2008

LINQ and Entity Framework Posts for 4/7/2008+

Note: This post is updated daily or more frequently, depending on the availability of new posts.

Comparison of "DataStores in the Cloud" Started

My Comparing Google App Engine, Amazon SimpleDB and Microsoft SQL Server Data Services post of April 9, 2008 is the beginning of a full-length comparison of Amazon SimpleDB, SQL Server Data Services, and Google App Engine beta versions.

As of April 10, 2008, the introduction and Data Model sections are complete.

Update 4/12/2008: Security and authentication topics expanded and moved to the "API" section, "API" section updated with query syntax and API limitations.

Added: 4/10/2008, Updated 4/12/2008

Jeff Currier Explains How to Use the cURL Utility with SQL Server Data Services

According to its author, Daniel Stenberg:

cURL is a command line tool for transferring files with URL syntax, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TFTP, TELNET, DICT, LDAP, LDAPS and FILE. curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading, HTTP form based upload, proxies, cookies, user+password authentication (Basic, Digest, NTLM, Negotiate, Kerberos...), file transfer resume, proxy tunneling and a busload of other useful tricks.

Jeff's cURL'ing up with SQL Server Data Services post of April 12, 2008 shows you how to use cURL at the command prompt to query an SSDS authority, as well as create containers and create, update and delete entities from file-based templates.

Added: 4/13/2008

Rick Strahl Encounters an Anomaly in LINQ to SQL Behavior with Object Tracking Disabled

Object tracking creates a very small performance hit, so it's a common practice to set DataContext.ObjectTrackingEnabled = false if you don't intend to update entities. However, you receive an "Object Reference not set to an instance of an object" exception if the entity has deferred loading associations. Eager loading is required in this case.

Rick's LINQ to SQL ObjectTrackingEnabled and Deferred Loading of Related Data of April 12, 2008 notes:

It turns out that this is a known issue that has been reported on Connect before.

and he goes on to quote Alex Turner's response to the Connect Bug report, which explains the reason for throwing the exception.

Added: 4/13/2008

Sahil Malik Writes a Windows Communication Foundation Tutorial

You need to know how to create WCF services and clients if you intend to try n-tier deployment of LINQ to SQL or the Entity Framework. Sahil's irreverent approach to his tutorials makes them more interesting (and informative) than the ordinary step-by-steps from MSDN and elsewhere.

He starts the series with four (count 'em, four) posts on April 12, 2008:

  • What is WCF? explains the basics of Service Oriented Architecture (SOA) and what makes WCF different from its Web service predecessors.
  • Writing the WCF Hello World App shows you how to create a WCF service class library, add a WCF service, and edit and implement the ServiceContract interface. Sahil also explains the mysteries of the App.config file (for a class library, yet!)
  • Writing your first WCF client demonstrates using dynamic proxy generation with metadata from the mex endpoint or metadata predistributed to the client in a DLL.
  • Host a WCF Service in IIS 7 & Windows 2008 - The right way shows you how to deploy a WCF service to IIS 7.0, a topic that Sahil says appears "nowhere else on the web." The process is by no means straightforward.

It will be interesting to see if more episodes follow.

Added: 4/13/2008

Beth Massi Starts LINQ to SQL N-Tier Smart Client Series

Beth's LINQ to SQL N-Tier Smart Client - Part 1 Building the Middle-Tier post of April 12, 2008 covers the following topics about the middle tier:

  • The Great Debate - DataSets or objects?
  • Going N-Tier with LINQ to SQL
  • Contract First
  • Disconnected Retrieval
  • Disconnected Updates and Deletes

Full VB 2008 code for the middle tier is included. Beth promises that her next post in the series "we'll build our client form and implement a simple technique for change tracking."

Added: April 12, 2008

Guy Burstein: Download the .NET 3.5 Enhancements Training Kit Preview

Guy's .NET 3.5 Enhancements Training Kit is available for Download says:

The Developer and Platform Evangelism Group in Microsoft has created a new training kit for all the enhancements for the .Net Framework 3.5:

  • ASP.NET MVC
  • ASP.NET Dynamic Data
  • ASP.NET AJAX History
  • ASP.NET Silverlight controls
  • ADO.NET Data Services
  • ADO.NET Entity Framework

Download the training kit (34.9 MB)

The April Content Preview contains Developer and Platform Evangelism Group's elementary Hands-on Labs for ADO.NET Entity Framework, ADO.NET Data Services, and ASP.NET Dynamic Data. Content for the Presentations, Demos, Screencasts, and Resources "will be added in a future release of the training kit.

Added: April 12, 2008

Upcoming Microsoft Developer Webcasts about LINQ and ADO.NET Data Services

From Scott Lum's MSDN Online Media Blog: Upcoming Microsoft Developer Webcasts: WCF, WF, Linq, AJAX, IIS 7.0, MS Sync Framework post:

MSDN Webcast: geekSpeak: Inside LINQ to XML with Paul Sheriff (Level 200)
In this episode of geekSpeak, Microsoft Regional Director Paul Sheriff explains how to put LINQ to XML to work in your applications. Guest Presenters: Paul Sheriff, President, PDSA, Inc. He has authored several books, webcasts, videos, and articles on the Microsoft .NET Framework, Microsoft SQL Server, and Windows SharePoint Services.
4/16/2008 12:00 PM - 1:00 PM Pacific Time | Duration: 60 Minutes

MSDN Webcast: LINQ Features in Visual Studio 2008 (Level 200)
Think you have heard all there is to know about Microsoft .NET Language-Integrated Query (LINQ)? Think again! In this webcast, we dazzle and amaze you with our staggering array of wondrous tools to make your LINQ experience a memorable one! Presenter:: Zain Naboulsi, Developer Evangelist, Microsoft CorporationTechnology is useless if it does not serve a clear purpose. That's Zain's philosophy. In fact, showing people how technology can make their lives better delivers his greatest on-the-job thrills
4/16/2008 1:00 PM - 2:30 PM Pacific Time | Duration: 90 Minutes

MSDN Webcast: Offline Data Synchronization with the Microsoft Sync Framework (Level 100)
In this webcast, we give an overview of the Microsoft Sync Framework and describe its key components that enable any data store to exchange information. We examine the built-in synchronization providers, Sync Services for ADO.NET, Sync Services for File Systems, and Sync Services for FeedSync, in addition to explaining how to implement custom synchronization providers for custom data sources. Lastly, we take a look at an example of using the Microsoft Sync Framework along with the new Microsoft SQL Server Data Services to provide synchronization capabilities across multiple applications, like Microsoft Office Access and Outlook. Presenter: Lindsay Rutter, Developer Evangelist.
4/17/2008 10:00 AM - 11:00 AM Pacific Time | Duration: 60 Minutes

Related Topic

MSDN Webcast: Database Features in Visual Studio 2008 (Level 200)
Like working with data? The Microsoft Visual Studio 2008 development system comes with many new and improved data tools. Who could say no to those cute little controls? Join this webcast for the ultimate database tools experience that you can have without a laser light show! Presenter: Zain Naboulsi, Developer Evangelist.
4/17/2008 1:00 PM - 2:30 PM Pacific Time | Duration: 90 Minutes

Added: April 12, 2008

Pratik Patel Describes the IUpdatable Interface for ADO.NET Data Services

The new IUpdatable interface supports create, update, and delete (CUD) operations on ADO.NET Data Services entities. Pratik's IUpdatable & ADO.NET Data Services Framework post of April 10, 2008 to the Astoria Team Blog describes the interface's following 10 methods:

  • CreateResource()
  • GetResource()
  • SetValue()
  • GetValue()
  • SetReference()
  • AddReferenceToCollection()
  • RemoveReferenceFromCollection()
  • DeleteResource()
  • SaveChanges()
  • ResolveResource()

Pratik promises "some examples and the sequence of calls made on the IUpdatable interface for each of them" in a follow-on post, as well as "features like ETag, Update interceptors" in later posts.

Added: April 10, 2008

White Paper: How to Choose a Data Synchronization Technology

Liam Cavanaugh's How to Choose a Data Synchronization Solution for Offline and Collaboration post of April 10, 2008 says the following about this Microsoft whitepaper about choosing between multiple sync technologies;

[W]e have posted a document titled "How to Choose a Data Synchronization Solution" which is an attempt to differentiate the offline and collaborations solutions available from Microsoft.  Hopefully this will help you better understand the various data sync technologies as well as to help answer the question of which technology is best suited for your particular needs.

Added: April 10, 2008

Rob Conery Starts a Series of MVC Storefront Tutorials

Rob describes his series as follows:

I'm creating an ongoing series of webcasts and blog posts, documenting the building of an eCommerce storefront using ASP.NET MVC. It's important to understand that this application has not been built yet - you're gonna help me do it :).

The goal is to build this application as openly, and "currently" as possible using an Agile approach with TDD. My goal is to post to this series at least twice a week as I build this application, taking your feedback and adjusting/discussing issues as they come up.

The project uses LINQ to SQL as its default data source, but Rob plans to plug in NHibernate and Subsonic later in the series.

Here are the episodes as of April 10, 2008:

So far, Rob has received plenty feedback on his "Agile approach with TDD" from TDD purists. His MVC Storefront: Intermission post of April 8, 2008 documents his reaction to the comments to the first two posts.

Added: April 10, 2008

Scott Guthrie: ASP.NET Dynamic Data Preview Available

Scott's ASP.NET Dynamic Data Preview Available post of April 10, 2008 includes the following description:

This new dynamic data preview now works with the standard built-in ASP.NET data controls (GridView, ListView, FormView, DetailsView, etc).  The dynamic data support enables these controls to automatically handle foreign-key relationships.  For example, on a gridview you'll now get automatic friendly name display of foreign key column values and automatic drop-down list selection support of these values when in edit mode.

The preview doesn't yet support Entity Framework. According to David Ebbo's day-earlier post of the same name:

Note that even though the drop has the ability to support Entity Framework (in addition to Linq To Sql), you will not quite be able to use it yet because it targets an Entity Framework build that is newer than the latest public build.  But don't worry, it won't be long before the missing pieces that will allow this are made available.

Added: April 10, 2008

Chris Rock Continues His LINQ to SQL Dynamic Queries Series

His LINQ TO SQL Dynamic Queries #3 (And's & Or's Together) post of April 10, 2008 extends his quest for dynamic Where clauses in LINQ to SQL expression. His previous two posts on this topic are:

LINQ TO SQL Dynamic Queries (And Operators)
LINQ TO SQL Dynamic Queries (Or Operators)

Added: April 10, 2008

Damien Guard Creates a Tiny Class to Enumerate Enums with LINQ

Damien's Using LINQ to foreach over an enum in C# post of April 10, 2008 describes a small Enums class to enable:

foreach(CustomerTypes customerType in Enums.Get<CustomerTypes>())

Cool.

--rj

Calais.NET Abstracts RDF Metadata from HTML, XML and Plain Text Documents with LINQ to XML

Chris Fulstow, an ASP.NET developer in Sydney, has written a API wrapper for the Calais Web service "that abstracts away web service details like complex XML input parameters and verbose RDF output data by processing the data with LINQ to XML." Chris's Calais.NET - generating metadata using the Calais web service post of March 21, 2008 explains his open-source project, which is licensed under the Microsoft Reciprocal License (Ms-RL) and available for download from Codeplex.

You pass the URL for an HTML, XML or plain text document to the Calais.NET API wrapper and receive a IEnumerable<string> of Resource Description Format (Semantic Web) entities that the Calais Web service detects in the document. For the current list of entities that Calais claims to detect, go to Calais Semantic Metadata.

Calais, which is sponsored by Reuters, delivers a free Web service that has this lofty goal and components:

The Calais initiative seeks to help make all the worlds content more accessible, interoperable and valuable via the automated generation of rich semantic metadata, the incorporation of user defined metadata, the transportation of those metadata resources throughout the content ecosystem and the extension of it’s capabilities by user-contributed components.

The Calais initiative has three major components:

  • The Calais Web Service is the core. The Web service provides for the automated generation of rich semantic metadata in RDF format.
  • A series of sample applications to demonstrate how the web service can be utilized and serve as a starting point for other’s development activities.
  • Active support for developers that want to incorporate Calais capabilities in their applications and web sites.

The Calais initiative is sponsored by Reuters and built on ClearForest technology.

Calais was the primary topic of The semantic web: Start making sense story for The Economist's "Technology Monitor" column of April 9, 2008. The column also mentions a number of other startups whose business plans relate to extracting metadata from ordinary text

Added: April 10, 2008

Danny Simmons: Visual Studio 2008/.NET Framework 3.5 SP1 to be Entity Framework's Shipping Vehicle

Danny wouldn't provide a date, but advises in EF will ship with SP1 of VS 2008/.Net Framework 3.5 (April 9, 2008) that EF will ship in VS2008 SP1 "this summer" and that EF beta bits will be in the forthcoming VS 2008 SP1 beta.

Danny also says that he'll be at DevConnections in Orlando in a couple of weeks giving these two EF presentations:

VMD314: Entity Framework in the Real World
Daniel Simmons
Come see the Entity Framework in action! Check out an exciting new open source application built on the Entity Framework. During this session we’ll discuss and demo the use of the Entity Framework to build a LOB application in the healthcare vertical.

VDM215: Entity Framework: Application Patterns
Daniel Simmons
Microsoft is introducing the ADO.NET Entity Framework and the Entity Data Model to help developers code against first-class business objects when creating business applications. Like any new technology, most of the information available on the topic focuses on what the Entity Framework is, what are its constituting components and related aspects. This session takes the audience beyond the “what“ of the Entity Framework, instead delving into various application scenarios and approaches to application architecture to show how one can use the Entity Framework today. We shall discuss the role of Entity Framework in Web, rich-client, and service-oriented applications.

Ryan Dunn Posts First SQL Server Data Services Sample App Available to Download or Test

It might have a funky name but Ryan's PhluffyFotos Sample Available post of April 9, 2008 is the first of what I hope will be several sample applications that use SSDS as their data source. Following are highlights:

    • This sample has a LINQ-to-SSDS provider in it.  You will notice we don't use any strings for queries, but rather lambda expressions. I had a lot of fun writing the first version of this and I would expect that there are a few more revisions here to go. Of course, Matt Warren should get a ton of credit here for providing the base implementation.
    • This sample also uses a very simplistic ASP.NET Role provider for SSDS. Likely updates here will include encryption and hashing support.
    • We have a number of Powershell cmdlets included for managing authorities and containers.

You must have credentials for the SSDS limited beta to run the sample code. If you don't, here's a link to an online version.

Beth Massi Offers Link List for VS 2008 N-tier Application Resources

Beth has accumulated a feed of Resources for Building N-tier Applications (April 9, 2008), which includes N-Tier and Remote Applications with LINQ to SQL.

Liam Cavanagh Demonstrates FeedSync Between Machines with the Sync Framework

Using the Microsoft Sync Framework to upload data to SQL Server Data Services (SSDS) isn't a built-in feature yet, but the following sample project will give you a leg up when Sync becomes the favorite way of keeping offline data sources synchronized.

According to Liam's Synchronization of Browser Favorites using FeedSync and the Microsoft Sync Framework of April 8, 2008:

At first, creating a new provider and figuring out how to make it sync can be a little intimidating. In order to help you through the process, we will walk through the creation of a simple provider that can sync between directories that contain Favorites. We will start first with the metadata store that the provider will use, since considering how metadata will be stored is the first step a provider writer should take when writing a provider. On top of this, we will build the provider, which will provide our actual sync capability. Then, we will use this provider to produce and consume feeds so that we can share our favorites between computers.

Liam presented Sync to the Web - Enable Offline Access to Web Data from any Data Store, which covers the use of Sync Framework with SSDS, at MIX 08.

Pablo Castro wants Input for Batching ADO.NET Data Services Requests

Pablo's Batching Data Service Requests post of April 6, 2008 casts a net for suggestions from developers and data architects for the syntax of batched CRUD operations with Astoria.

Ryan Dunn Interviews SSDS Architects Istvan Cseri and Nigel Ellis for Channel9

The blurb for the Istvan Cseri and Nigel Ellis: SQL Server Data Services Architecture interview posted April 7, 2008 says:

SQL Server Technical Evangelist Ryan Dunn sits down and talks turkey with two of the creators of SQL Server Data Services (SSDS), Architect Istvan Cseri and Development Manager Nigel Ellis. Istvan and Nigel dig into how to design applications for SSDS and cover a number of the interesting aspects of working with SSDS in terms of features, design, and security.

If you're interested in working with SSDS, don't miss this video segment.

Debra Dove: Avoid SQL Server 2008 (Katmai) Connection Problems

If you're using a pre-release version of SQL Server 2008 (Katmai) you've probably performed the required patches. If not, read Debra's Connecting to Pre-Release Versions of SQL Server 2008 – Part Deux of April 7, 2008.

Note that neither LINQ to SQL or Entity Framework will support SQL Server 2008's GEOMETRY or GEOGRAPHY datatypes or SPARSE columns.

Paul Stovell Demonstrates SyncLINQ for Silverlight in a Live Application

Paul's SyncLINQ for Silverlight post of April 7, 2008 has an embedded Silverlight app that demos data binding with his open source SyncLINQ project.

Note that the entries you add don't persist.

Updated Version of "Rumor: Google to Compete with SimpleDB and SSDS with Bigtable as a Web Service"

My post about the Google App Engine, which undoubtedly will compete with SQL Server Data Services, has been extensively updated to cover it's release to limited beta status on Monday night, April 7, 2008.

Saturday, March 01, 2008

LINQ and Entity Framework Posts for 2/25/2008+

Note: This post is updated daily or more often, depending on the availability of new articles.

New "Model Domain Objects with the Entity Framework" Article in Visual Studio Magazine for March 2008

Visual Studio Magazine's March 2008 cover story is my "Model Domain Objects with the Entity Framework" article. Here's the deck:

Microsoft's ADO.NET Team readies Entity Framework and Tools 1.0 for release as a VS 2008 add-in with enterprise-level features that LINQ to SQL doesn't offer—domain object modeling, flexible inheritance techniques, multiple database vendors, and do-it-yourself n-tier deployment.

The story covers new and modified EF features since my "Objectify Data with ADO.NET vNext" article in the October 2006 issue.

A sidebar describes Danny Simmons' EntityBag (Perseus) project for "do-it-yourself n-tier deployment."

Erratum: Entity SQL does have a JOIN command but it's used to join unrelated entities only. The eSQL NAVIGATE command is used with associations and navigation properties, which represent INNER JOINs at the conceptual level.

Added: 3/1/2008

ADO.NET Data Services (Astoria) Becomes the Framework for All Window Live Services

In honor of the announcement by Pablo Castro that "all Windows Live services can be accessed using AtomPub" ADO.NET Data Services has been rechristened the "ADO.NET Data Services Framework." [Emphasis added.] This term was occasionally used in documentation for Astoria's December 2007 CTP. Here's the official story from MIX08:

Accessing Windows Live Services via AtomPub

Friday, March 7 8:30 AM - 9:45 AM, Delfino 4105
Speaker(s): Pablo Castro
Audience(s): Technical
Session Type: Breakout

Come learn how Microsoft is moving towards a unified approach for accessing online services based on AtomPub. We cover how all Windows Live services can be accessed using AtomPub as well as how integrated Microsoft Visual Studio support including ADO.NET Data Services Framework (aka Project "Astoria") allows anyone to easily develop, deploy, and access online services using AtomPub. [Emphasis added and typo fixed.]

Whaddya bet that everyone continues to call it "Astoria?"

Added: 3/1/2008

Dan Wahlin Posts Layered LINQ to SQL Sample Application

Dan's Building an N-Layer ASP.NET Application with LINQ, Lambdas and Stored Procedures (Updated) post of February 28, 2008 provides a description of a four-layer (presentation layer, business layer, data layer and model layer) ASP.NET/LINQ to SQL demo application that lets you choose between LINQ, lambda functions, and stored procedures for queries. Dan databinds his ListView and GridView controls to an ObjectDataSource (rather than a LinqDataSource), apparently because of the multiple query types he uses.

The demo project, which is available for download from a link on his above post, is for his presentation at ASP.NET Connections Orlando in April:

ADX211: Building N-Tier Applications with LINQ
Dan Wahlin
Creating a modular and maintainable application architecture is always a key part of the application development life cycle. In this session you'll learn how to build N-Tier/N-Layer applications that leverage Language Integrated Query (LINQ) to minimize development time while still maintaining module design practices. Topics covered include using the Visual Studio 2008 LINQ to SQL designer, using data context objects, and performing different types of LINQ queries.

Dan's earlier LINQ and Lambdas and Sprocs....Oh My! post explains why he uses the three query types.

Note that the demo is N-Layer, not N-Tier.

Added: 2/29/2008

Doug Rothaus and Avner Aharoni Start LINQ to XML VB Cookbook Series

Doug says in the VB Team's VB XML Cookbook, Recipe 1: XML Transformations using XML Literals (Doug Rothaus) post of February 29, 2008:

I was working on a blog entry about replacing XSLT transforms with Visual Basic XML Literals. As the entry progressed, I noticed that it was really, really long. So, Avner Aharoni and I talked things over and we decided to break it up into multiple entries and start a series, much like the LINQ Cookbook that was started a few months back.

This first episode shows you how to replace <xsl:copy-of>, <xsl:for-each>, <xsl:template>, <xsl:if>, <xsl:value-of>, and <xsl:attribute> elements as well as use XML Axis Properties in place of XPath.

As I said in a comment to this post:

Scott Guthrie doesn't worry about long posts. His First Look at Using Expression Blend with Silverlight 2 post of February 28, 2008 was about 15 feet long. There's no question about the popularity of Scott's posts.

These linkblog posts sometime reach close to that length, but mine don't come anywhere near the popularity of his tutorials.

Added: 2/29/2008

Christian Kleinerman's Video Extols New Developer Features in SQL Server 2008

This might seem off-topic but Channel9's Christian Kleinerman: SQL Server 2008 for Developers video segment (posted February 29, 2008) covers some topics of specific interest to LINQ to SQL and Entity Framework developers, to wit:

  • SQL Management Studio improvements including IntelliSense
  • New Data Types for just dates or times (no more storing time when you only need the date)
  • New Hierarchical data support .IsDescendent(), that can automatically pull a hierarchical view of data (no more custom recursive queries)
  • New Grouping Sets statement which enables you to automatically group dimensions in a query for easy aggregation and reporting
  • New Merge statement which provides automatic insert/update semantics for keeping multiple data sources in sync
  • New FileStream attribute that enables you to include files that are stored in the server file system, but can be managed by SQL Server
  • New data types and support for Geodata and geometry
  • New support for optimizing "empty" or row/column tables using the sparse keyword

.IsDescendent() relies on the new hierarchyid data type, whose value represents the encoded position in a tree hierarchy.

You can learn more about converting a table that is structured as a parent/child hierarchy and move the data into a new table that represents the hierarchy and then manipulate that data in the Tutorial: Using the hierarchyid Data Type topic. Not surprisingly, the tutorial uses the AdventureWorks Employee table to construct a "reports-to" hierarchy to replace a self-join. The same technique could be applied to the Northwind Employees table.

Note: It's not clear yet how or if LINQ to SQL or the Entity Data Model will suppory hierarchyid tables.

Caution: Euan Garden notes in his SQL Server 2008 CTP's and "Leap Day" post of February 29, 2008 that SQL Server 2008 services will not start during the 24 hours of February 29, 2008 GMT.

He recommends: Do NOT stop or restart any SQL Server 2008 services during those 24 hours. (There are no workarounds.)

It's fortunate that Katmai didn't release at the release party or earlier. There would have been bad news today.

Added: 2/29/2008

Chris Rock Attacks Dynamic LINQ to SQL Queries

Orlando, FL developer Chris Rock (not the comedian) digs into creating Dynamic LINQ queries with Joe and Ben Albahari's LinqKit Predicate Builder in the LINQ TO SQL Dynamic Queries post of January 24, 2008 and the follow-up LINQ TO SQL Dynamic Queries #2 (Or statements) of February 27, 2008.

The latter post demonstrates that you can create dynamic LINQ to SQL Queries with AND, as well as OR clauses, in C# or VB.

Added: 2/29/2008

Use LINQ to Manipulate Excel Data

Denis van der Stelt's Getting data from Excel the fast way, using LINQ post of February 29, 2008 shows you how to process Excel data with the Microsoft.Jet.OLEDB.4.0 data provider, a DataTable for the worksheet and LINQ to DataSets.

The whole process, including enumeration, takes only nine lines of C# code (if you consider the LINQ expression to be one line.)

An alternative is to use Cozy Yamaguchi's LINQ to Excel, the source code for which is downloadable from CodePlex. (There was no release when this post was written.)

Added: 2/29/2008

Charlie Calvert Updates List of Third-Party LINQ Providers

Charlie's Link to Everything: A List of LINQ Providers post of February 28, 2008 lists 22 third-party LINQ providers (Bart De Smet renamed LINQ to LDAP to LINQ to Active Directory).

My list of LINQ to ... labels at the left has a few more items but includes Microsoft providers, such as LINQ to REST (part of the ADO.NET Data Services client library), and some that are works in progress (e.g., LINQ to LLBLGen Pro.)

A few significant third-party LINQ providers/APIs missing from Charlie's post are:

Added: 2/29/2008

David Treadwell: Atom and AtomPub Support for Windows Live Photos and Application Based Storage

The February 27, 2008 David Treadwell on New and Updated Windows Live Platform Services post to the Windows Live Dev News blog includes an "Atom Publishing Protocol (AtomPub) as the future direction" topic that states:

At MIX we are enabling several new Live services with AtomPub endpoints which enable any HTTP-aware application to easily consume Atom feeds of photos and for unstructured application storage (see [here] for more details). Or you can use any Atom-aware public tools or libraries, such as .NET WCF Syndication to read or write these cloud service-based feeds. [Emphasis added.]

For more information, see Atom and AtomPub Support Extended to Windows Live Photos and Application Based Storage of February 29, 2008.

David Treadwell is Microsoft's Corporate Vice President, Live Platform Services, which include "unified identity and directory, data synchronization, transport and presence, among others." He's also the Microsoft representative to DataPortability.org.

Added: 2/28/2008 Moved to separate post: 2/29/2008

Marcin Dobosz Details Dynamic Data's Project Templates

In his Project templates just got bigger post of February 27, 2008, Marcin contrasts the precocial Visual Studio 2008 templates used by ASP.NET Dynamic Data with the altricial templates of most other VS project types. (Not being a biologist, this was the first time I can recall hearing these terms.)

ASP.NET Dynamic Data's December CTP supports LINQ to SQL data sources only because the EntityDataSource control wasn't available for the Entity Framework. David Ebbo mentioned in a comment to his Dynamic Data screencast is now available! post of December 12, 2007, that;

Linq To Entities will indeed have improved support for this [many:many associations], and generally make it easier.

As of the December Preview, DynamicData only supports Linq To Sql, but the next public build will include Entities support. [Emphasis added.]

Hopefully, Marcin's pre-MIX post means that the "next public build" will accommodate an available EntityDataSource control.

Added: 2/28/2008

Rob Conery Uses LINQ to SQL's Contains() Operator for Predictive Modeling SQL IN Predicates

Rob starts his Creating IN Queries With Linq To Sql post of February 27, 2007 with:

Props on this one go to Scott Hanselman who pulled me back from the edge of the cliff last night. I was particularly distraught in getting a MIX demo together where I had to do some queries using LINQ, and I couldn’t for the life of me figure out how to fashion an IN query! With Scott’s help (and patience) I figured it out, and thought I should blog for my own reference, at least.

Jim Wooley beat Scott and Rob to the punch on the use of Contains with an array last August. I left this comment:

I believe Jim Wooley was the first to suggest the Contains trick in his Use the new LINQ “Contains” extension method for the SQL “IN” clause post of August 06, 2007.

At least that’s the first instance I’ve seen.

But then he goes on in another post to describe "LINQ gymnastics" for predictive cross-sell modeling—the technique for showing "items that other people bought, most often, when they bought the product the user just added to their basket."

The solution, described in his LINQ Gymnastics: Creating A Predictive Query With LINQ post of the same day, requires five chained query expressions to produce this SQL to list the top five matches from the Adventure Works database:

SELECT [t0].[ProductID], [t0].[Name], [t0].[ProductNumber], [t0].[MakeFlag], [t0].[FinishedGoodsFlag], [t0].[Color], [t0].[SafetyStockLevel], [t0].[ReorderPoint], [t0].[StandardCost], [t0].[ListPrice], [t0].[Size], [t0].[SizeUnitMeasureCode], [t0].[WeightUnitMeasureCode], [t0].[Weight], [t0].[DaysToManufacture], [t0].[ProductLine],
[t0].[Class], [t0].[Style], [t0].[ProductSubcategoryID], [t0].[ProductModelID], [t0].[SellStartDate], [t0].[SellEndDate], [t0].[DiscontinuedDate], [t0].[rowguid], [t0].[ModifiedDate]
FROM [Production].[Product] AS [t0]
INNER JOIN (
    SELECT SUM(CONVERT(Int,[t1].[OrderQty])) AS [value], [t1].[ProductID]
    FROM [Sales].[SalesOrderDetail] AS [t1]
    WHERE (EXISTS(
        SELECT NULL AS [EMPTY]
        FROM [Sales].[SalesOrderHeader] AS [t2]
        INNER JOIN [Sales].[SalesOrderDetail] AS [t3] ON [t2].[SalesOrderID] = [t3].[SalesOrderID]
        WHERE ([t2].[SalesOrderID] = [t1].[SalesOrderID]) AND ([t3].[ProductID] = @p0)
        )) AND ([t1].[ProductID] <> @p1)
    GROUP BY [t1].[ProductID]
    ) AS [t4] ON [t0].[ProductID] = [t4].[ProductID]
ORDER BY [t4].[value] DESC

As Rob says:

I can rewrite that query into a Sproc, lose 60% of the SQL, and be done with this whole thing in very short order. In addition, all of the LINQ statements amount to a lot of extra code just to build a SQL statement. However…

If you break our your queries into steps and add some comments, like I did here, you understand a whole heck of a lot more what I, the stats wonk, am trying to do.  If you were to stumble accross a predictive Sproc in the DB, you would no doubt spend a whole lot of time trying to figure just WTF I was thinking.

Added: 2/27/2008

Bob Beauchemin Starts a Series About LINQ to SQL and Entity Framework

Bob's MHO: LINQ to SQL and Entity Framework: Panacea or evil incarnate? Part 1 post of February 13, 2008 (which I missed), spells out the misgivings of a well-known SQL Server trainer (for SQLSkills), tuner and developer about the use of LINQ to SQL and Entity Framework in an enterprise IT environment. He lists the following six "worry points":

  1. LINQ to SQL and EF will proliferate dynamic SQL, and will almost surely produce suboptimal dynamic SQL, causing database performance problems and plan cache pollution. And dynamic SQL is evil to start with.
  2. LINQ to SQL and EF will encourage "SELECT * FROM..." style coding because you get back a nice, clean object this way instead of the less-useful anonymous type you receive by doing projection. This will also make most/all covering indexes useless.
  3. LINQ to SQL and EF will encourage "SELECT to middle-tier, then update/delete" rather than issuing direct SQL UPDATE/DELETE statements that are set-based.
  4. LINQ to SQL and EF will write code that gets too much or too little data at a time. This is a variation of #2. Too much data in one query is a waste. Too little data is also bad because it means extra database round-trips.
  5. LINQ to SQL and EF will discourage the use of stored procedures to return rowsets; returning rowsets in stored procedures is *thought to be* superior to returning them in dynamic SQL. In addition, the code generators will use a subset of T-SQL query constructs, that is, only the constructs that the LINQ or ESQL language supports, rather than the full power of the T-SQL query language.
  6. LINQ to SQL and EF queries will be "untunable" because, even if you discover a performance problem, you can't change the underlying API code to produce the exact SQL query that you want. There's too many layers of abstraction to change it

The post above covers worry point #1. Chris Rock makes some interesting observations on proliferating query plans with parameterized queries and stored procedures in his LINQ TO SQL V 1.0 Hickups post of February 19, 2008.

MHO: LINQ to SQL and Entity Framework: Panacea or evil incarnate? Part 2 of February 14, 2008 tackles worry point #2

Added: 2/27/2008

Joe Feser Unveils LINQ to NCover for Code-Coverage Analysis

NCover is a commercial package for reporting the code coverage of unit tests for .NET projects. NCover has two versions: Professional (US$149) and Enterprise (US$299). The Enterprise edition provides detailed HTML reports and XML code-coverage data; Professional only outputs the XML data as Coverage.xml.

Taking advantage of the XML code-coverage data requires sophisticated querying and sorting capabilities, so Joe Feser wrote the code for LINQ to NCover, which is available for download from a link in his Linq To NCover Part 2 post of February 26, 2008. LINQ to NCover processes queries, such as the following:

c = CodeCoverage.Load(file);

var retVal =from mod in c.Modules
            from cls in mod.Classes
            from method in cls.Methods
            where method.Name == ".ctor"
            select method;

His earlier Linq To NCover Part 1 post of the same day provides additional background on the project and mentions that he went to work for Gnoso, Inc., NCover's publisher, in Taylors (a suburb of Greenville), SC.

Added: 2/27/2008

Matt Hidinger Discovers That the Entity Framework Won't Filter by Comparing Custom Classes

In his Entity Framework Comparison Frustration: Explained post of February 26, 2008, Matt attempts to run the following code

TorvusEntities entities = new TorvusEntities();

// Pull my Account Entity from the database
Account matt = entities.Accounts.First(a =&gt; a.AccountId == 10);

// Attempt to get all Teams by a Team Owner
var teams = from t in entities.Teams
            where t.Owner == matt
            select t;

And receives an exception because:

LINQ to Entities does not support using a user class as a constant. However, a property reference on a user class is considered a constant, and will be converted to a command tree constant expression and executed on the data store.

From the "Comparison Expressions" topic of the LINQ to Entities Programming Guide.

Matt's earlier post on the topic is ADO.NET Entity Framework Comparison Frustration.

Julie Lerman Delivers a Hit .NET Rocks! Podcast About Entity Framework (and Admits to an Entity Framework Book in Progress)

Don't miss it. You can listen to it here.

She also comes clean in her Okay, so I'm writing a book post of February 27, 2008 that she's writing Programming Entity Framework for O'Reilly which she hopes will release in October. I'm really sorry she couldn't have a Newfi (Newfoundland dog) engraving on the cover because it had been used for a VBA book. :-(

The title has a bit in common with David Sceppa's Programming the Microsoft® ADO.NET Entity Framework for Microsoft Press (due in July).

Added: 2/27/2008

Michael DeMond Adds an EDMX Code Generator Plug-in to EFContrib

Michael's Plug-in Edmx Code Generator Released post of February 25, 2008 describes the code-generator plug-in he derived from the earlier Sample Edmx Code Generator by Sanjay Nagamangalam, an ADO.NET program manager. Michael's is the second project contributed to CodePlex's EFContrib project.

The first comment to Sanjay's SampleEdmxCodeGenerator sources post of January 24, 2008 is the request for a plug-in version. It was nice of Michael to comply.

Thanks to Julie Lerman for the heads-up.

Added: 2/27/2008

Alex James Completes His Teasers About Entity Teamwork Support for Associations with Payloads

Alex observed in his first Associations with Payloads post of 2/24/2008, that Entity Framework (EF) automatically creates a many:many association instead of an entity for a table that consists entirely of two (or more) foreign key fields, but won't ordinarily do this if the association carries a payload, such as quantity. (See LINQ and Entity Framework Posts for 2/18/2008+).

Next, his Associations with Payloads - part Deux post of 2/25/2008 concludes that a read-only association is the only way to circumvent the restriction without resorting (?) to a conventional entity.

Finally (!), Alex's Associations with Payloads - closing the loop later the same day describes the seven hand-hewn modifications to the mapping files that are required to implement a read-only many:many association with a payload.

Sounds to me like a lot of work to enable this LINQ to Entities query:

var products = from o in ctx.Orders 
               from p in o.Products 
               where o.ID == 3435 
               select p;

Entity Framework Workaround for SQL Server 2008 Spatial Data Type

Alex James points in his strangely-named All the power at your disposal post of February 25, 2008 to a SQL 2008 and spartial data post by 'Benys' in the ADO.NET (Pre-release) forum. Benys' post is a great example of developer self-reliance in the face of what appear to be poor odds.

Benys asked if EF supports SQL Server 2008's spatial datatype. According to Danny Simmons, who should know:

Unfortunately, no, the EF will not support spatial data from SQL Server 2008 in EF v1.  Spatial data in SS08 is a kind of user-defined-type, and while UDTs are something that the EF will support in future releases they do present some unique challenges and in the end were postponed to a later release.

Benys solved the problem with a defining query and a partial class to return the spatial value as a binary data type.

Beth Massi Demonstrates LINQ to SQL Data Validation with Partial Classes and Partial Methods

Beth's Simple Validation with LINQ to SQL Classes post of February 25, 2008 describes in detail the steps required to:

  1. Implement the IDataErrorInfo interface
  2. Inherit the implementing class from partial EntityName classes
  3. Write the business rules to perform the validation
  4. Display the validation errors in the UI

Beth's tutorials have become to VB projects what Scott Guthrie's are to C# and ASP.NET projects.

Andrew Robinson: Set LINQ to SQL Text Box MaxLength with Reflection

In his TextBox MaxLength from LINQ Meta Data post of February 24, 2008, Andrew shows you how to write an ExpressionBuilder to set the MaxLength properties of bound ASP.NET text box controls by reflection. He also includes the addition to the Web.config's <system.web><compilation> section to load the ExpressionBuilder.

Thursday, July 12, 2007

VS 2008 Beta 2 Due by End of July, RTM by End of Year

Hard on the heels of the Orcas June 2007 CTP, you can expect the Visual Studio 2008 Beta 2 bits to be released by July 30, 2007. According to Scott Guthrie's reply to a comment in his July 9, 2007 VS 2008 Nested Master Page Support post:

VS 2008 Beta2 should be available for free download in the next three weeks. It will support a go-live license. [Emphasis added.]

Doug Seven, project manager for Visual Studio Team System, says in his July 10, 2007 Windows Server 2008, Visual Studio 2008 and Microsoft SQL Server 2008 Joint Launch Announced post:

While the launch events are scheduled to kick off on February 27, 2008, Visual Studio 2008 will be released before the end of the year.

Update 7/12/2007 11:30 p.m. PDT: Bill McCarthy set me straight (again) about the "bug" below in a comment. I had forgotten to add the Of preposition for an (Of DateTime?) type assignment in the translation from C# <DateTime?> to VB. (I canceled the bug report.) Guess I've been writing too much C# code lately (or I need more sleep.)

Hopefully, "fixed in Beta 2" promises for by the LINQ to SQL team will be kept and the bug I reported with nullable field values in LINQ to DataSet Select projections for VB projects will be corrected in Beta 2.

As Bill noted in his Connect bugs scare me post today, the VB Team member handling bug reports didn't catch the missing Of preposition either. Here's the "resolution" proposed:

Thanks for your feedback. We have reproduced this bug on Visual Studio Codename Orcas June CTP, and we are sending this bug to the appropriate group within the VisualStudio Product Team for triage and resolution.

I agree with Bill that the compiler error messages should suggest adding Of.

SQL Server 2008 (formerly codenamed "Katmai") will "launch" in February 2008 but won't release to manufacturing until the second quarter of 2008, according to today's ARE You Ready to Rock? Launch 2008--it's official! post by Michael J. Murphy.

Friday, June 01, 2007

Google Gears Piques New Interest in Data Synchronization

Google's announcement of their new Gears browser extension API for enabling offline capabilities in Web apps with these services:

  • LocalServer to cache and serve application resources locally.
  • Database (SQLite) to serve as a searchable local data store with online synchronization capability
  • WorkerPool to enable clients to run resource-intensive operations on a new thread

Google's Choosing an Offline Application Architecture page shows how the client application's UI can switch between the Web server and local database cache as its data source. Running SQLite or any other database in the browser requires write access to the client's file system. Synchronization can be manual, as in the Gears-enabled Google Reader (a button toggles between online and offline mode), or background, which can take advantage of the WorkerPool.

Update 6/2/2007: Tim Anderson's Why Google Gears? Thoughts from Google Developer Day provides an independent overview of Google Gears and notes the importance of synchronization. Tim also mentions full-text search in his SQLite will be everywhere post. According to Michael Cleverly's October 11, 2006 blog entry for D. Richard Hipp's keynote at the 13th Annual Tcl/Tk Conference:

As of SQLite 3.3.8 (released Monday!) full text search support in SQLite. Richard's authorized to announce help from engineers at Google. Later question elicited that roughly half of the FTS code was written by Richard and Dan, the other half by four engineers from Google. He isn't able to/can't comment on their motivations/plans/internal usage. [Minor edits.]

[The blog also notes that Microsoft uses SQLite in the Xbox.]

Google's Database API page states, "Google Gears includes SQLite's full-text search extension fts2."

Scott Hanselman says in his Google Gears - Maybe all Rich Internet Applications needed was Local Storage and an Offline Mode post:

Stunning move by Google today in the Rich Internet Application space. While most of us (myself included) are off debating Flash vs. Silverlight vs. Apollo vs. Whatever, Google introduces Google Gears ... a technology all of the above (or none of the above) can utilize ...

This is a huge move and is quite brilliant. In one seemingly innocuous move (and one tiny 700k (yes, 700K) download) Google is well positioned to get Google Docs, including Writely, Spreadsheet and Presentation, along with who knows what else, enabled for offline use. And the whole thing is Open Sourced via the New BSD License.

Dare Obasanjo quotes Robert Scoble's Google brings developers offline with “Gears”; new offline Reader post, and asks "[W]hat took them so long?", and closes with "Welcome to the future."

Robert says:

Gears supports using Adobe’s Apollo and Flash and should support other technologies including Microsoft’s Silverlight. [Emphasis added.]

But eWeek's Darryl K. Taft clarifies Gears' support for Silverlight in today's "Google Gears Aims to Bolster Adobe Apollo, Others" article:

Meanwhile, Google Gears will work with Microsoft's Silverlight cross-platform, cross-browser tool for building RIAs. Gears hopes to complement Microsoft's Silverlight and other technologies by offering an offline infrastructure that developers can incorporate into any Web application—even those that use plug-ins from other companies, a Google spokesperson said. [Emphasis added.]

However, Microsoft has its own local database cache: SQL Server Compact Edition (SSCE) and Synchronization Services (Sync Services). Orcas Beta 1 includes Sync Services Beta 1 and an early version of the graphical Sync Designer for SSCE 3.5. Sync Services is limited to synchronization between SSCE 3.1 or 3.5 on the client side and SQL Server 200x behind the Web server. Unfortunately, SSCE v3.x doesn't have full-text search capability.

Presumably, it would be possible to install the SSCE bits (1.8 MB) in conjunction with the Silverlight 1.1 runtime (4.2 MB) but you'd also need to install at least the Sync Services client pieces. The entire gears.dll is 852 kB for IE and 700 kB for Firefox. (The SQLite library itself varies in size from 224 to 513 kB, depending on options). However, a more appropriate comparison might include the 2.3 MB for the Flash player and its helper file. Note that the Gears library doesn't include a synchronization service. Developers would need to write their own service, which is no small chore (especially in JavaScript.)

Update 6/6/2007: Dare analyzes Google Gears in his June 5, 2007 Google Gears: Replacing One Problem with Another post and concludes that the missing synchronization component might be a showstopper:

It seems that without providing data synchronization out of the box, Google Gears leaves the most difficult and cumbersome aspect of building a disconnected Web app up to application developers. This may be OK for Google developers using Google Gears since the average Google coder is a Ph.D but the platform isn't terribly useful to Web application developers who want to use it for anything besides a super-sized HTTP cookie.

Collectively, the comments to Dare's post point out that general-purpose synchronization systems aren't easy to get right and that users of the Gears toolkit will need to write their own sync services. One commenter (Sam Sethi) points out that the Remember the Milk online to-do list has added Google Gears synchronization.

Update 6/7/2006: eWeek's Microsoft Watch blogger, Joe Wilcox, posted his Can Microsoft Be the Wrench in Google Gears? article on June 6, 2007. Joe quotes the same paragraph from Date's entry (above), and observes:

Quite possibly, synchronization is the killer app that will determine whether desktop software maintains its relevance or the Web becomes the more popular platform. ... The natural place for synchronization services is as part of the operating system.

Microsoft DevSource's Jeff Cogswell responded to Joe's post in his June 7, 2007 Synchronization: The future of the web? item:

Unfortunately, I think Joe's blog is missing something here, and I'm speaking as a developer. Synchronizing data is never a trivial nor generic task, because how it works and what it does depends on the particular application, and often requires substantial user input, and is heavily tied to file formats and how the data is organized inside the file.

ZDNet Blogger David Berlind posted an audio interview about Google Gears that he conducted on May 30, 2007 with Google director of engineering Linus Upson. Berlind quotes Adobe’s vice president of product management Michele Turner:

[W]e were developing identical technology to facilitate the offline component of the Apollo runtime. ... For example, they’re [Google] using SQLite and we were already incorporating SQLite into Apollo. So, now we’re aligning our efforts with Google on things like the synchronous and asynchronous calls that must be made to the SQLite database in order to enable the offline capability.

Google Gears piqued more interest in data synchronization than I expected.

Recent Microsoft Synchronization Services Updates

My "Update Local Data Caches with Sync Services" article in the May 2007 issue of Visual Studio Magazine carries this deck:

"The Microsoft Synchronization Services 1.0 API for SQL Server 2005 Compact Edition and the new Sync Designer in the Orcas March 2007 CTP team up to generate a local data cache that synchronizes incrementally and bidirectional with SQL Server [Express]."

Sync services and the Sync Designer is the technology behind Occasionally Connected Systems, which--together with the Entity Framework--comprise the Dynamic Development "Pillar of Katmai."

My earlier "Lighten Up Your Local Databases" in the March 2007 Visual Studio Magazine issue covers SQL Server 2005 Compact Edition v3.1 , which is the first version licensed for use in conventional PCs, and v3.5, which is included in Visual Studio codename "Orcas." Microsoft initially called V3.5 "SQL Server Everywhere Edition." V3.5 adds important features, such as timestamp fields to aid synchronization and simplify concurrency conflict detection. SQL Server Mobile Edition v3.0 and earlier were licensed for use by devices and Tablet PCs only.

Microsoft's Rafik Robeal released Demo VII: Tombstone Cleanup and Detecting Stale Offline Clients for the Sync Services runtime. Tombstone cleanup detects and prevents stale clients from synchronizing and tells them to reinitialize their local data cache. A stale offline client is a computer that hasn't synchronized in the last n days, so the client's sync request is rejected.

Rafik has updated the preceding six demos to VS Orcas Beta 1 in his Sync Services Demos Refresh post:

Update 6/6/2007: Rafik just added a Sync Events for Conflict Handling, Progress Reporting, Business Logic … post that describes Sync Services new set of events. Some of the events are implemented in Beta 1, but you'll have to wait for Beta 2 for the others. See my Synchronization Services Runtime Beta 1 for ADO.NET 2.0 Is Available and A Sync Services Bidirectional Test Harness posts for issues with the Beta 1 release.