<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.silverlight.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>LINQ To SQL</title><link>http://blogs.silverlight.net/blogs/jesseliberty/archive/2008/03/26/linq-to-sql.aspx</link><description>A number of folk have written to me in response to my 3rd tutorial asking that I spend some time focusing on how to obtain data from a SQL database. This is the topic for tutorial #4, to be released on April 1. A few interesting issues arose when writing</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>re: LINQ To SQL</title><link>http://blogs.silverlight.net/blogs/jesseliberty/archive/2008/03/26/linq-to-sql.aspx#221999</link><pubDate>Wed, 20 May 2009 03:27:17 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:221999</guid><dc:creator>collection_knowledge</dc:creator><description>&lt;p&gt;Hi Jesse,&lt;/p&gt;
&lt;p&gt;I have a problem in my code, I'm a newbie in silverlight. My problem is in joing two tables and select only the specific columns. &lt;/p&gt;
&lt;p&gt;Here is my code:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Public Function GetParentAndChildList() As Object Implements IChannelService.GetParentAndChildList&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim db As ChannelDataContext = New ChannelDataContext&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dim channelMatch = From channelRow In db.channels _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Join parentChild In db.ChannelParentChildListings _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; On channelRow.channel_id Equals parentChild.parent_id _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Where channelRow.parent_id.Equals(0) _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Order By channelRow.title Ascending _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Select channelRow.channel_id, channelRow.title, parentChild.child, parentChild.child_id&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Return channelMatch &amp;nbsp; &amp;nbsp;&amp;lt;-------- Error throw Unable to cast object of type &lt;/p&gt;
&lt;p&gt;'System.Data.Linq.DataQuery`1[VB$AnonymousType_1`4[System.Int32,System.String,System.String,System.Nullable`1[System.Int32]]]' to type 'System.Collections.Generic.List`1[Media.channel]'.&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;End Function&lt;/p&gt;
&lt;p&gt;Hope you could help me. Thanks&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=221999" width="1" height="1"&gt;</description></item><item><title>re: LINQ To SQL</title><link>http://blogs.silverlight.net/blogs/jesseliberty/archive/2008/03/26/linq-to-sql.aspx#41824</link><pubDate>Fri, 28 Mar 2008 01:05:59 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:41824</guid><dc:creator>wisecarver</dc:creator><description>&lt;p&gt;You surprised me bro...&lt;/p&gt;
&lt;p&gt;Didn't list the current best book on LINQ.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.amazon.com/LINQ-Action-Fabrice-Marguerie/dp/1933988169/"&gt;www.amazon.com/.../1933988169&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=41824" width="1" height="1"&gt;</description></item><item><title>re: LINQ To SQL</title><link>http://blogs.silverlight.net/blogs/jesseliberty/archive/2008/03/26/linq-to-sql.aspx#41345</link><pubDate>Wed, 26 Mar 2008 19:10:34 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:41345</guid><dc:creator>Rubicon</dc:creator><description>&lt;p&gt;Hi Jesse, great work your doing on SL2&lt;/p&gt;
&lt;p&gt;In the upcoming tutorial would you be able to demonstrate how to format eg. a Date in the code-behind file. What I mean is, if the data in the database is not in a proper format how do you convert it when retrieved using LINQ, are you able to do it both in the code-behind file as well as in the XAML-code?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Arne&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=41345" width="1" height="1"&gt;</description></item><item><title>re: LINQ To SQL</title><link>http://blogs.silverlight.net/blogs/jesseliberty/archive/2008/03/26/linq-to-sql.aspx#41333</link><pubDate>Wed, 26 Mar 2008 18:55:09 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:41333</guid><dc:creator>BenHayat</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt;Ben, I didn't but after you read the tutorial if you still want that let me know and I'll do a blog entry on it. However, it really isn't silverlight, it's just LINQ&amp;lt;&amp;lt;&lt;/p&gt;
&lt;p&gt;I'm pretty comfortable with LINQ2SQL, what want to &amp;nbsp;find out is the communication and data transfer between client and middle tier when creating/updating records.&lt;/p&gt;
&lt;p&gt;I think until MS come out with a std approach for data handling out-of-the-box, we need to have some sort of guidelines how it should be done to maintain proper tracking and concurrency between client &amp;lt;-&amp;gt; data service &amp;lt;-&amp;gt; Database Server.&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=41333" width="1" height="1"&gt;</description></item><item><title>re: LINQ To SQL</title><link>http://blogs.silverlight.net/blogs/jesseliberty/archive/2008/03/26/linq-to-sql.aspx#41326</link><pubDate>Wed, 26 Mar 2008 18:31:20 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:41326</guid><dc:creator>jesseliberty</dc:creator><description>&lt;p&gt;Ben, I didn't but after you read the tutorial if you still want that let me know and I'll do a blog entry on it. However, it really isn't silverlight, it's just LINQ &amp;nbsp;&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=41326" width="1" height="1"&gt;</description></item><item><title>re: LINQ To SQL</title><link>http://blogs.silverlight.net/blogs/jesseliberty/archive/2008/03/26/linq-to-sql.aspx#41323</link><pubDate>Wed, 26 Mar 2008 18:24:24 GMT</pubDate><guid isPermaLink="false">d0d632c8-a6f7-4f68-b0ce-26aaafd62132:41323</guid><dc:creator>BenHayat</dc:creator><description>&lt;p&gt;Jesse, when you create this tutorial for SL, could you please show the four operations (Create, Retrieve, Update and Delete)?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;..Ben&lt;/p&gt;
&lt;img src="http://blogs.silverlight.net/aggbug.aspx?PostID=41323" width="1" height="1"&gt;</description></item></channel></rss>