View Single Post
  #1 (permalink)  
Old March 7th, 2009, 07:06 PM
AgentSmith AgentSmith is offline
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Default Advanced Data Query and Databinding

I have the following situation. I have two data sources of different types that I need to join.

The first data source is a direct database query, I'd like to use Linq for. Each row has a DocId column.

The other data source is an array of Document objects that is returned from a web service call. Each Document has an array of properties. Each property is a key-value pair.

I want to join the first datasource's DocId column on each Document object's property with a key of DocId. I then want to bind a datagrid to the resulting data source.

One, can I even do this? Can I combine LinqToObjects with LinqToSQL like this? Must I convert my Document objects from having an array of key-value propeties to having named properties, especially since I need to bind the resulting data to a datagrid?

i.e.
<Property name="DocId" value="1001" />
into
<DocId>1001</DocId>