<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblogcasts.com/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>Simons SQL Blog : LINQ</title><link>http://sqlblogcasts.com/blogs/simons/archive/tags/LINQ/default.aspx</link><description>Tags: LINQ</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Entity framework support for table valued functions and thus full text</title><link>http://sqlblogcasts.com/blogs/simons/archive/2011/01/30/entity-framework-support-for-table-valued-functions-and-thus-full-text.aspx</link><pubDate>Sun, 30 Jan 2011 14:12:03 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:15304</guid><dc:creator>simonsabin</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/rsscomments.aspx?PostID=15304</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/commentapi.aspx?PostID=15304</wfw:comment><comments>http://sqlblogcasts.com/blogs/simons/archive/2011/01/30/entity-framework-support-for-table-valued-functions-and-thus-full-text.aspx#comments</comments><description>One of my most popular posts with over 10, 000 hits is how to enable full text when using LINQ to SQL http://sqlblogcasts.com/blogs/simons/archive/2008/12/18/LINQ-to-SQL---Enabling-Fulltext-searching.aspx , core to this is the use of a table valued function...(&lt;a href="http://sqlblogcasts.com/blogs/simons/archive/2011/01/30/entity-framework-support-for-table-valued-functions-and-thus-full-text.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=15304" width="1" height="1"&gt;</description><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Full+Text/default.aspx">Full Text</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/LINQ+To+SQL/default.aspx">LINQ To SQL</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Entity+framework/default.aspx">Entity framework</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/ORM/default.aspx">ORM</category></item><item><title>Entity Framework how to stop your DBA having a heart attack</title><link>http://sqlblogcasts.com/blogs/simons/archive/2010/01/30/Entity-Framework-how-to-stop-your-DBA-having-a-heart-attack.aspx</link><pubDate>Sat, 30 Jan 2010 14:30:32 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:12954</guid><dc:creator>simonsabin</dc:creator><slash:comments>10</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/rsscomments.aspx?PostID=12954</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/commentapi.aspx?PostID=12954</wfw:comment><comments>http://sqlblogcasts.com/blogs/simons/archive/2010/01/30/Entity-Framework-how-to-stop-your-DBA-having-a-heart-attack.aspx#comments</comments><description>
&lt;p&gt;My code and presentation from my session at Developer 
Day 8 are now available here&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.sqlknowhow.com/presentations/ddd_8/DDD_8-Entity_Framework.zip"&gt; DDD_8-Entity_Framework Code&lt;/a&gt; &lt;br /&gt;
&lt;a href="http://www.sqlknowhow.com/presentations/ddd_8/Entity_Framework.pptx"&gt;Entity framework presentation &lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;Any questions let me know.&lt;/p&gt;
&lt;p&gt;Also for more on the new features in Entity Framework v next go to &lt;a href="http://blogs.msdn.com/adonet/archive/2009/08/05/improvements-to-the-generated-sql-in-net-4-0-beta1.aspx"&gt;http://blogs.msdn.com/adonet/archive/2009/08/05/improvements-to-the-generated-sql-in-net-4-0-beta1.aspx&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;
&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; 
&lt;/script&gt;
&lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=12954" width="1" height="1"&gt;</description><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Performance/default.aspx">Performance</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Community/default.aspx">Community</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Speaking/default.aspx">Speaking</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Entity+framework/default.aspx">Entity framework</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Query+Tuning/default.aspx">Query Tuning</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/DDD/default.aspx">DDD</category></item><item><title>Using LINQ with unfriendly collections</title><link>http://sqlblogcasts.com/blogs/simons/archive/2009/01/15/Using-LINQ-with-unfriendly-collections.aspx</link><pubDate>Thu, 15 Jan 2009 14:18:25 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11199</guid><dc:creator>simonsabin</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/rsscomments.aspx?PostID=11199</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/commentapi.aspx?PostID=11199</wfw:comment><comments>http://sqlblogcasts.com/blogs/simons/archive/2009/01/15/Using-LINQ-with-unfriendly-collections.aspx#comments</comments><description>
&lt;p&gt;I&amp;#39;ve liked the idea of LINQ in that you can query in 
memory collections. It saves a huge amount of code if you want to filter users 
by other criteria.&lt;/p&gt;
&lt;p&gt;I&amp;#39;d seen demos and just couldn&amp;#39;t figure out how it worked because I was just getting a red suiggly 
line&lt;/p&gt;
&lt;p&gt;
&lt;img src="http://sqlblogcasts.com/Photos/blogimages/images/11198/480x480.aspx" alt="" /&gt;


&lt;p&gt;&amp;quot;Error&amp;nbsp;2&amp;nbsp;Could not find an implementation of the query pattern for 
source type &amp;#39;System.Web.Security.MembershipUserCollection&amp;#39;.&amp;nbsp; &amp;#39;Where&amp;#39; not 
found.&amp;nbsp; Consider explicitly specifying the type of the range variable 
&amp;#39;u&amp;#39;.&amp;quot;&lt;/p&gt;
&lt;p&gt;Now sometimes you just have a mental block but I couldn&amp;#39;t figure out what I 
needed to do to get it working, and I&amp;#39;m sure some onf you reading will be 
in&amp;nbsp;&amp;quot;Who wants to be a millionaire&amp;quot;&amp;nbsp;mode and will be telling me exactly 
what the answer is, its obvious.&lt;/p&gt;
&lt;p&gt;Well I&amp;#39;m sure I tried what is the correct solution but to no avail.&lt;/p&gt;
&lt;p&gt;Anyway I needed to do this again recently and rather than 
resort to a for loop and a break statement etc I persevered, and soon realised 
on reading the error message and taking my time was that a simple LINQ query has 
implied types, i..e in my example the variable &amp;quot;u&amp;quot; (the range variable)&amp;nbsp;is type based on the items in the collection on the right 
just like var does. However in this case it can&amp;#39;t infer the type and 
so you have to force the type i.e. &lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;span style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;var&lt;/span&gt;&lt;span style="FONT-SIZE:9pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt; 
MatchedUsers = (&lt;span style="COLOR:blue;"&gt;from&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;MembershipUser&lt;/span&gt; u &lt;span style="COLOR:blue;"&gt;in&lt;/span&gt; &lt;span style="COLOR:#2b91af;"&gt;Membership&lt;/span&gt;.FindUsersByEmail(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;SomeEmail&amp;quot;&lt;/span&gt;)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;span style="FONT-SIZE:9pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;where&lt;/span&gt; u.UserName != &lt;span style="COLOR:#a31515;"&gt;&amp;quot;Smith&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;span style="FONT-SIZE:9pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/span&gt;&amp;amp;&amp;amp; u.CreationDate &amp;gt; &lt;span style="COLOR:#2b91af;"&gt;DateTime&lt;/span&gt;.Now.AddDays(-1)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0cm 0cm 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;span style="FONT-SIZE:9pt;FONT-FAMILY:&amp;#39;Courier New&amp;#39;;mso-no-proof:yes;"&gt;&lt;span style="mso-spacerun:yes;"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;select&lt;/span&gt; u);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m sure this might not be as quick as doing the looping my self, but its 
a lot easier. Whats more if we want to do something else with this set of users 
we can do easily rather than having to loop over the whole collection 
again.&lt;/p&gt;&lt;hr /&gt;
-

&lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;
&lt;/script&gt;
 &lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11199" width="1" height="1"&gt;</description><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Tips+and+Tricks/default.aspx">Tips and Tricks</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/c_2300_/default.aspx">c#</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/LINQ/default.aspx">LINQ</category></item><item><title>Whats the score with LINQ to SQL?</title><link>http://sqlblogcasts.com/blogs/simons/archive/2008/11/16/Whats-the-score-with-LINQ-to-SQL-.aspx</link><pubDate>Sun, 16 Nov 2008 00:16:48 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:11027</guid><dc:creator>simonsabin</dc:creator><slash:comments>7</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/rsscomments.aspx?PostID=11027</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/commentapi.aspx?PostID=11027</wfw:comment><comments>http://sqlblogcasts.com/blogs/simons/archive/2008/11/16/Whats-the-score-with-LINQ-to-SQL-.aspx#comments</comments><description>
&lt;p&gt;LINQ to SQL (and any ORM for that matter) has the marmite factor. You either 
love it or hate it. Whats more many of those that hate it haven&amp;#39;t tried it. In 
many cases the hate it crowd are making a decision based on previous experience 
with systems using ORM solutions.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been looking at and trying to use LINQ to SQL for a while and thought I 
would post my findings thoughts. Before starting this series of posts I thought 
I would see what others have said. I had heard something about an announcement 
about LINQ to SQL and LINQ to Entities and found the post hear. &lt;a href="http://blogs.msdn.com/adonet/archive/2008/10/31/clarifying-the-message-on-l2s-futures.aspx"&gt;http://blogs.msdn.com/adonet/archive/2008/10/31/clarifying-the-message-on-l2s-futures.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I made a conscious decision to look at L2S rather that L2E for these 
reasons,&lt;/p&gt;
&lt;p style="MARGIN-LEFT:36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-list:Ignore;"&gt;1.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/span&gt;&lt;/span&gt;Its simpler&lt;/p&gt;
&lt;p style="MARGIN-LEFT:36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-list:Ignore;"&gt;2.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/span&gt;&lt;/span&gt;It allows separation of code and database mapping easily. This is 
commonly referred to as POCO&lt;/p&gt;
&lt;p style="MARGIN-LEFT:36pt;TEXT-INDENT:-18pt;mso-list:l0 level1 lfo1;"&gt;&lt;span style="mso-list:Ignore;"&gt;3.&lt;span style="FONT:7pt &amp;#39;Times New Roman&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;/span&gt;&lt;/span&gt;It supports more SQL features&lt;/p&gt;
&lt;p&gt;However it seems that L2E will be enhanced to include the L2S features that 
are missing.&lt;/p&gt;
&lt;p&gt;Thats a real shame and the biggest reason for me is the number of levels of 
interpretation.&lt;/p&gt;
&lt;p&gt;When you right a LINQ query with L2S your LINQ query is translated to an 
expression tree and then translated to SQL.&lt;/p&gt;
&lt;p&gt;With L2E you have an extra step because the entity framework is a framework 
that sits on stop of any provider (that has been written). To enable that it has 
its own data access language Entity SQL. So to get to SQL, your LINQ query is 
translated from LINQ to ESQL to SQL.&lt;/p&gt;
&lt;p&gt;Anyone thats worked or seen translated text will know that often what you put 
in is often not what you get out. There is a common games on radio in the UK 
where they translate an album/track name to a language and then back to English. 
The quiz is then to guess what the original album/track name was given the final 
translated text. (A bit like Chinese whispers).&lt;/p&gt;
&lt;p&gt;We all know how complex SQL is, so you can understand why generally the SQL 
you get from L2E is more complex than with L2S. &lt;/p&gt;
&lt;p&gt;I personally like to keep things simple and so I’m disappointed by the 
decision to concentrate. Although all is not lost. &lt;/p&gt;
&lt;p&gt;If you use standard practice of implementing a data layer then you could move 
to L2E in the future. Whats more your SELECT LINQ queries against a set of L2E 
objects should be similar to those for L2S. The main difference is when you want 
to do your insert, update and delete operations, the two technologies use 
different mechanisms. Further more you will likely have to change you validation 
code to use the different technology, although the core rules code shouldn’t 
have to change.&lt;/p&gt;
&lt;p&gt;I would still stick with L2S until the next version of EF. I&amp;#39;ll discuss some 
of my findings in future posts.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;
&lt;script type="text/javascript" src="http://sqlblogcasts.com/sitefiles/1000/Social_Buttons.js"&gt;&lt;/script&gt;
&lt;hr /&gt;
-
&lt;script type="text/javascript" src="http://sqlblogcasts.com/sitefiles/1000/google_rss.js"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;var height=90;var width=720;&lt;/script&gt;
&lt;script src="http://www.sqlknowhow.com/scripts/Banner.js" type="text/javascript"&gt;
&lt;/script&gt;
 &lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=11027" width="1" height="1"&gt;</description><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/LINQ/default.aspx">LINQ</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/LINQ+To+SQL/default.aspx">LINQ To SQL</category><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/Entity+framework/default.aspx">Entity framework</category></item><item><title>LINQ to SQL - Optimistic locking</title><link>http://sqlblogcasts.com/blogs/simons/archive/2008/01/21/LINQ-to-SQL---Optimistic-locking.aspx</link><pubDate>Mon, 21 Jan 2008 20:55:29 GMT</pubDate><guid isPermaLink="false">fa8c4e8e-46a3-4193-8264-2c1a9cb3475d:6306</guid><dc:creator>simonsabin</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/rsscomments.aspx?PostID=6306</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://sqlblogcasts.com/blogs/simons/commentapi.aspx?PostID=6306</wfw:comment><comments>http://sqlblogcasts.com/blogs/simons/archive/2008/01/21/LINQ-to-SQL---Optimistic-locking.aspx#comments</comments><description>
&lt;p&gt;Venturing into the world of LINQ I&amp;#39;m determined to give 
it a go because writing 3 -10 sps per table is just a pain in the bottom.&lt;/p&gt;
&lt;p&gt;If you come from a database background one of the things that will concern 
you is the SQL that LINQ generates. The good news is that you can capture all 
the SQL that LINQ generates by using the Log property of you data context. The 
following sets the PubsDataContext to log to the file c:\log.txt&lt;/p&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;&lt;font color="#2b91af" size="2"&gt;
&lt;p&gt;PubsDataContext&lt;/font&gt;&lt;font color="#000000" size="2"&gt; dc = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font color="#000000" size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;PubsDataContext&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#000000"&gt;();&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;TextWriter&lt;/font&gt;&lt;font size="2"&gt; tw = &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;new&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;StreamWriter&lt;/font&gt;&lt;font size="2"&gt;(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;c:\\log.txt&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/p&gt;
&lt;p&gt;dc.Log = tw;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;What I noticed straight away was updates, by 
default when an update is performed, irrespective of what columns are changed, 
all the columns are specified in the&amp;nbsp;WHERE clause. This is used to enforce 
optimistice locking. This is to&amp;nbsp; ensure that when you update data it hasn&amp;#39;t 
already been updated by someone else. The downside however is that every column 
has to be checked. &lt;/p&gt;
&lt;p&gt;You can change this behaviour on each column in the LINQ to SQL model that is 
generated by adding the UpdateCheck attribute i.e. &lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;[&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Column&lt;/font&gt;&lt;font size="2"&gt;(Storage=&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;_col2&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, 
DbType=&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Int&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;, 
UpdateCheck=&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;UpdateCheck&lt;/font&gt;&lt;font size="2"&gt;.Never)]&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;public&lt;/font&gt;&lt;font size="2"&gt; System.&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Nullable&lt;/font&gt;&lt;font size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt;&amp;gt; col2&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;get...&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;/font&gt;However its a bit of a pain to do that on each column in each 
table. However there is light at the end of the tunnel. If you have a timestamp 
on the table only this column will be check to verify the record has&amp;#39;t 
changed.&lt;/p&gt;
&lt;p&gt;You might be still asking why I want this at all. Imagine your bank account 
(£100 balance), you&amp;#39;ve cash a cheque £50&amp;nbsp;and you use the cash machine to 
withdraw £100, what if it happens that the bank pays the cheque into your 
account at the same time you use the cash point, both &amp;nbsp;read the balance at 
£100, the chequed is cashed updating it to £150, but then the cash point 
withdrawl updates the £100 balance with the £100 withdrawl leaving you with a 
balance of £0. What happened to the cheque?&lt;/p&gt;
&lt;p&gt;If the each transaction checked that the record had not been updated then it 
would have realised that the data had changed and the update would have failed. 
&lt;/p&gt;
&lt;p&gt;The other option is pessimistic locking, which puts a lock on a record for 
the duration that the record is being read until it is updated. This is not very 
good for concurrency as locks cause blocking and so the number of users you 
application will be able to support will not be very high.&lt;/p&gt;&lt;br /&gt;
&lt;script type="text/javascript" src="http://sqlblogcasts.com/sitefiles/1000/Social_Buttons.js"&gt;&lt;/script&gt;
&lt;hr /&gt;
-
&lt;script type="text/javascript" src="http://sqlblogcasts.com/sitefiles/1000/google_rss.js"&gt;
&lt;/script&gt;
&lt;script type="text/javascript"&gt;var height=90;var width=720;&lt;/script&gt;
&lt;script src="http://www.sqlknowhow.com/scripts/Banner.js" type="text/javascript"&gt;
&lt;/script&gt;
 &lt;img src="http://sqlblogcasts.com/aggbug.aspx?PostID=6306" width="1" height="1"&gt;</description><category domain="http://sqlblogcasts.com/blogs/simons/archive/tags/LINQ/default.aspx">LINQ</category></item></channel></rss>