<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>[How Do I:] LINQ to SQL: Overview</title><link>http://www.asp.net</link><pubDate>Thu, 18 Dec 2008 04:55:44 GMT</pubDate><generator>umbraco</generator><description>Comments for [How Do I:] LINQ to SQL: Overview</description><language>en</language><atom:link href="http://www.asp.net/rss/comments/37513" rel="self" type="application/rss+xml" /><item><title>Comment Posted by mcp111</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Tue, 04 Mar 2008 17:32:00 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006545</guid><description><![CDATA[ <p>This is a great overview but I&#39;m not really clear if LINQ is going to simplify my programming. Seems to be more complicated than SQL.</p> <p>I would also like to comment on the download links presentation. You have them as &quot;WMV WMV&quot;, etc - initailly I thought it was some kind of typo but when I hovered over them I found that one was for C# and the other was for VB. You need to present things in a more &quot;user-friendly&quot; manner with neat sub-headings as VB downloads and C# downloads so it is clear and neat!!!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/mcp111.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pfdpereira</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 05 Mar 2008 07:10:06 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006546</guid><description><![CDATA[ <p>just one question! where can i get the password for video zip files included in this page available to download?</p> <p>thanks,</p> <p> &#160; Paulo Pereira </p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/pfdpereira.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mcp111</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 05 Mar 2008 11:54:29 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006547</guid><description><![CDATA[ <p>When you post the comments on this website it would be more correct to say &quot;On March 04, 2008 mcp111 said ... &quot;</p> <p>You have the order all mixed up and it doesn&#39;t read well.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/mcp111.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by mcp111</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 05 Mar 2008 15:22:27 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006548</guid><description><![CDATA[ <p>Actually I&#39;m not sure why you have the audio downloads section. For a demo video is a must!</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/mcp111.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Freon22</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 19 Mar 2008 16:08:40 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006549</guid><description><![CDATA[ <p>I agree somewhat with mcp111 as far as simple queries, updates, or inserts. But I see Linq being a great help on complex queries, updates, and inserts. </p> <p>Not sure yet if using Linq will be any faster at run time. Has anyone tested to see if the runtime is the same as with writing your own t-sql statement.</p> <p>Anway good job so far on the videos.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Freon22.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by igavemybest</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Sat, 29 Mar 2008 01:19:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006550</guid><description><![CDATA[ <p>I actually just upgraded to VS2008 just for LINQ because I am doing a project that has extremely complicated SQL staments that are based off of variables that change depending on other changing variables, and on and on. &#160;I alway thought it would be so easy to do in VB. &#160;Well, now I can, freakin awesome! &#160;And by the way... runtime seems to be just as quick becuase all the SQL codebehind is actually there</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/igavemybest.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Freon22</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 02 Apr 2008 11:15:24 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006551</guid><description><![CDATA[ <p>I do have one problem with Linq! It does not seem to have a easy way to handle null returns. </p> <p>Like a user types in his login name and password but he made a mistake while typing his password. Now when you run the linq query it will not return anything and will throw an error. I have tryed the DefaultIfEmpty and a few other default types. Now I maybe coding it all wrong? Don&#39;t really know because there is not much infor, available on the net yet. Maybe someday someone will post some examples on how to work around these simple but painful errors.</p> <p>So if you want to use linq with a gridview, dropdown list and so on then Linq is great. But if all you want to do is to check a few values in a database or check to see if they are even in the database. Then save yourself the headache and use a t-sql query.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Freon22.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Freon22</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 02 Apr 2008 22:55:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006552</guid><description><![CDATA[ <p>Yesterday was not a good day, it seemed that I could not do a simple query that may have a null return. A few kind coders showed me where I was messing up. The funny thing about this is at one time I had it right. But for some unknown reason I failed to see it working when I tested it. So I moved on to trying to do it wrong again. lol I guess after seeing errors on every try I missed it when it worked. </p> <p>So I want to show a simple example on how to handle a null return or I should say how I needed to handle it in my code. In t-sql we could always use the reader.HasRows but in Linq you need to use DefaultIfEmpty, SingleOrDefault, or one of the other Defaults.</p> <p>registerDataContext db = new registerDataContext();</p> <p> &#160; &#160; &#160; &#160;var users = (from user in db.userAccounts</p> <p> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; where user.email == TextBox1.Text</p> <p> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; select user).SingleOrDefault();</p> <p> &#160; &#160; &#160; &#160;//Check if users is null.</p> <p> &#160; &#160; &#160; &#160;if (users != null)</p> <p> &#160; &#160; &#160; &#160;{</p> <p> &#160; &#160; &#160; &#160; &#160; &#160;Label1.Text = string.Format(&quot;&lt;h2&gt;The email address &lt;font color=&#39;red&#39;&gt;{0}&lt;/font&gt; already exist!&lt;/h2&gt;&quot;, TextBox1.Text);</p> <p> &#160; &#160; &#160; &#160;}</p> <p> &#160; &#160; &#160; &#160;else</p> <p> &#160; &#160; &#160; &#160;{</p> <p> &#160; &#160; &#160; &#160; &#160; &#160;Label1.Text = string.Format(&quot;&lt;h2&gt;The email address &lt;font color=&#39;red&#39;&gt;{0}&lt;/font&gt; does not exist!&lt;/h2&gt;&quot;, TextBox1.Text);</p> <p> &#160; &#160; &#160; &#160;}</p> <p>Another way of making this same query is.</p> <p> &#160; &#160; &#160; &#160;registerDataContext db = new registerDataContext();</p> <p> &#160; &#160; &#160; &#160;userAccount users = db.userAccounts.SingleOrDefault(p =&gt; p.email == TextBox1.Text);</p> <p> &#160; &#160; &#160; &#160;if (users != null)</p> <p> &#160; &#160; &#160; &#160;{</p> <p> &#160; &#160; &#160; &#160; &#160; &#160;Label1.Text = string.Format(&quot;&lt;h2&gt;The email address &lt;font color=&#39;red&#39;&gt;{0}&lt;/font&gt; is already exist!&lt;/h2&gt;&quot;, TextBox1.Text);</p> <p> &#160; &#160; &#160; &#160;}</p> <p> &#160; &#160; &#160; &#160;else</p> <p> &#160; &#160; &#160; &#160;{</p> <p> &#160; &#160; &#160; &#160; &#160; &#160;Label1.Text = string.Format(&quot;&lt;h2&gt;The email address &lt;font color=&#39;red&#39;&gt;{0}&lt;/font&gt; does not exist!&lt;/h2&gt;&quot;, TextBox1.Text);</p> <p> &#160; &#160; &#160; &#160;}</p> <p>I hope this may save someone else from pulling out their hair.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Freon22.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by TheDirtyBird</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 23 Apr 2008 16:13:00 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006553</guid><description><![CDATA[ <p>Good intro video. &#160;</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/TheDirtyBird.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by suyog.dabhole</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Thu, 15 May 2008 02:36:38 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006554</guid><description><![CDATA[ <p>very helpful series.</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/suyog.dabhole.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by fher</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Thu, 15 May 2008 22:23:48 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006555</guid><description><![CDATA[ <p>For some reason the sample code in the Default.aspx file first line reads in part like this: </p> <p>CodeBehind=&quot;Default.aspx.vb&quot; Inherits=&quot;LINQPart1._Default&quot;</p> <p>But the sample code also includes a “Default.aspx.vb” file which handles the vb code, in order for the samples to work and be editable change that to something like: </p> <p>CodeFile=&quot;Default.aspx.vb&quot; Inherits=&quot;_Default&quot;</p> <p>That is if you want to do the very same thing Scott is doing and follow along</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/fher.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Aditya640</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 04 Jun 2008 12:05:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006556</guid><description><![CDATA[ <p>I have a problem:-</p> <p>After learning linq.</p> <p>I thought about testing it..</p> <p>I have a table with the following fields.</p> <p>name[..varcher(50)..notnull]</p> <p>title[..varchar(50)..notnull]</p> <p>id[..primary key..increment +1..int]</p> <p>I have a linq to sql classes named dataclasses.dbml</p> <p>here is my query</p> <p>Dim db As New DataClassesDataContext</p> <p> &#160; &#160; &#160; &#160;Dim p As New testing With {.name = &quot;ad&quot;, .title = &quot;adi&quot;}</p> <p> &#160; &#160; &#160; &#160;db.testings.InsertOnSubmit(p)</p> <p> &#160; &#160; &#160; &#160;db.SubmitChanges()</p> <p>Here is my error..</p> <p>It crashes on db.SubmitChanges()</p> <p>With this error...</p> <p>The null value cannot be assigned to a member with type System.Int32 which is a non-nullable value type.</p> <p>Please help.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Aditya640.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by jobejufranz</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Fri, 27 Jun 2008 05:50:23 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006557</guid><description><![CDATA[ <p>I think Scott forgot one of the most important thing...</p> <p>How to setup and configure your &quot;LINQ TO SQL Classes&quot; to connect to the DB.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/jobejufranz.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by pnv.ravikiran</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 02 Jul 2008 01:03:27 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006558</guid><description><![CDATA[ <p>Good Introduction Video</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/pnv.ravikiran.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by huykhoi8384</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Thu, 24 Jul 2008 06:43:21 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006559</guid><description><![CDATA[ <p>very good. Thanks</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/huykhoi8384.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by Hamza_zarar</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Sat, 26 Jul 2008 00:26:17 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006560</guid><description><![CDATA[ <p>very good tutorial for the beginner.</p>]]></description><enclosure length="0" type="image/png" url="http://i3.asp.net/avatar/Hamza_zarar.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by suryabeniwal</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Sat, 02 Aug 2008 02:30:15 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006561</guid><description><![CDATA[ <p>i have problem to update first record ?</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/suryabeniwal.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by cv_vikram</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Thu, 14 Aug 2008 18:25:40 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006562</guid><description><![CDATA[ <p>thanks....</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/cv_vikram.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by ashrafur</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Tue, 26 Aug 2008 07:08:32 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006563</guid><description><![CDATA[ <p>Nice one for the beginner, thank :)</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/ashrafur.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by aliuos</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Wed, 10 Sep 2008 04:37:03 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006564</guid><description><![CDATA[ <p>This is a nice tutorial.</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/aliuos.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by hphamvan</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Tue, 23 Sep 2008 11:26:09 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006565</guid><description><![CDATA[ <p>Nice</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/hphamvan.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by djibril_chimere_DIAW</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Fri, 24 Oct 2008 05:42:16 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006566</guid><description><![CDATA[ <p>Thanks !J&#235;r&#235;j&#235;f!</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/djibril_chimere_DIAW.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by rami_nassar</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Tue, 09 Dec 2008 11:56:10 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006567</guid><description><![CDATA[ <p>good start</p>]]></description><enclosure length="0" type="image/png" url="http://i1.asp.net/avatar/rami_nassar.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by beaudeep</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Sat, 13 Dec 2008 10:47:26 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006568</guid><description><![CDATA[ <p>Very Good I&#39;ll Start Now :)</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/beaudeep.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item><item><title>Comment Posted by edwardkieran</title><link>http://www.asp.net/web-forms/videos/data-access/how-do-i-with-linq/how-do-i-linq-to-sql-overview</link><pubDate>Thu, 18 Dec 2008 04:55:44 GMT</pubDate><guid isPermaLink="false">00000000-0000-0000-000000006569</guid><description><![CDATA[ <p>I have downloaded mpeg-4 (c#) video first and there appeared a blanck screen after 5:12 minutes, then downloaded 3gp version but the same thing happened at exactly the same minute. How come were you able to watch the whole video sequence?</p>]]></description><enclosure length="0" type="image/png" url="http://i2.asp.net/avatar/edwardkieran.jpg?forceidenticon=false&amp;dt=635049507000000000&amp;enableAvatar=False&amp;cdn_id=2013-05-10-001" /></item></channel></rss>