<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.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>Write Less, Do More, &lt;br&gt;But Keep It Simple - All Comments</title><link>http://weblogs.asp.net/bschooley/default.aspx</link><description>by Bernal Schooley</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Debug Build: 20510.895)</generator><item><title>re: ASP.Net : Clean up your use of ViewState</title><link>http://weblogs.asp.net/bschooley/archive/2007/09/29/asp-net-clean-up-your-use-of-viewstate.aspx#6956790</link><pubDate>Thu, 12 Mar 2009 22:06:45 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6956790</guid><dc:creator>...</dc:creator><description>&lt;p&gt;Sehr wertvolle Informationen! Empfehlen!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6956790" width="1" height="1"&gt;</description></item><item><title>re: ASP.Net : Clean up your use of ViewState</title><link>http://weblogs.asp.net/bschooley/archive/2007/09/29/asp-net-clean-up-your-use-of-viewstate.aspx#6955727</link><pubDate>Wed, 11 Mar 2009 23:04:51 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6955727</guid><dc:creator>...</dc:creator><description>&lt;p&gt;Gute Arbeit hier! Gute Inhalte.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6955727" width="1" height="1"&gt;</description></item><item><title>re: LINQ to SQL : Handling disconnected CRUD operations in ASP.Net</title><link>http://weblogs.asp.net/bschooley/archive/2007/09/29/linq-to-sql-handling-disconnected-crud-operations-in-asp-net.aspx#6896278</link><pubDate>Tue, 10 Feb 2009 02:33:46 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6896278</guid><dc:creator>Tom</dc:creator><description>&lt;p&gt;re: Thomas&lt;/p&gt;
&lt;p&gt;I think the method being described solves both of your issues because you *do not* send every field to the client, and therefore you *do not* have to verify that they've tampered with anything (aside from the primary key and the version, which, if they were tampered with, would cause a conflictexception anyhow). &lt;/p&gt;
&lt;p&gt;This seems like a very basic scenario (sending an update without having to requery) and it's very disappointing that LINQ doesn't have a good answer for this without us having to hack around, force fields to be marked as changed, etc.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6896278" width="1" height="1"&gt;</description></item><item><title>re: LINQ to SQL : Start with a good foundation by defining a custom DataContext</title><link>http://weblogs.asp.net/bschooley/archive/2007/09/28/linq-to-sql-start-with-a-good-foundation-by-defining-a-custom-datacontext.aspx#6353070</link><pubDate>Thu, 03 Jul 2008 11:59:01 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6353070</guid><dc:creator>Webys</dc:creator><description>&lt;p&gt;I have a little problem I'm a beginner in LINQ to SQL and I've follow the tutorial from ScottGu's blog: &lt;a rel="nofollow" target="_new" href="http://weblogs.asp.net/scottgu/archive/2007/07/16/linq-to-sql-part-5-binding-ui-using-the-asp-linqdatasource-control.aspx"&gt;weblogs.asp.net/.../linq-to-sql-part-5-binding-ui-using-the-asp-linqdatasource-control.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;All was ok I use VS 2008 (I've converted from VB.NET to C# , I use C#) but when I wish to put the code from App_Code in an sub dir like DAL or BLL (for extensibility of entities like products with partial clases) and generate again the dblm file I've receiving en error:&lt;/p&gt;
&lt;p&gt;1. first in my BLL dir from App_Code:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; public partial class Product&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;partial void OnValidate(System.Data.Linq.ChangeAction action)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (action == ChangeAction.Update &amp;amp;&amp;amp; this.Discontinued == true &amp;amp;&amp;amp; this.UnitsOnOrder &amp;gt; 0)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;throw new ArgumentException(&amp;quot;Record level can't be grather than 0 if Product is Discontinued&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;} &lt;/p&gt;
&lt;p&gt; and I've included the namespace : using DAL; &lt;/p&gt;
&lt;p&gt;... but still error message is :No defining declaration found for implementing declaration of partial method 'Product.OnValidate(System.Data.Linq.ChangeAction)'&lt;/p&gt;
&lt;p&gt; 2 &amp;nbsp;If i comment all BLL code from my extensibility partial class Product I receive an general error:&lt;/p&gt;
&lt;p&gt;Could not load type 'NorthwindDataContext'.&lt;/p&gt;
&lt;p&gt;Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.&lt;/p&gt;
&lt;p&gt;Exception Details: System.Web.HttpException: Could not load type 'NorthwindDataContext'.&lt;/p&gt;
&lt;p&gt;Source Error:&lt;/p&gt;
&lt;p&gt;An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. &lt;/p&gt;
&lt;p&gt;Stack Trace:&lt;/p&gt;
&lt;p&gt;[HttpException (0x80004005): Could not load type 'NorthwindDataContext'.]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +565&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.LinqDataSourceView.get_ContextType() +68&lt;/p&gt;
&lt;p&gt;[InvalidOperationException: Could not find the type specified in the ContextTypeName property of LinqDataSource 'CategoryLinqDS'.]&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.LinqDataSourceView.get_ContextType() +193&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.LinqDataSourceView.CreateContextAndTable() +458&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.LinqDataSourceView.EnsureContextAndTable(Boolean selecting) +39&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +421&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +92&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.ListControl.PerformSelect() +31&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +26&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.Control.PreRenderRecursiveInternal() +86&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.Control.PreRenderRecursiveInternal() +170&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.Control.PreRenderRecursiveInternal() +170&lt;/p&gt;
&lt;p&gt; &amp;nbsp; System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041&lt;/p&gt;
&lt;p&gt;--------------------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433&lt;/p&gt;
&lt;p&gt;Thanks in advance guys. :)&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6353070" width="1" height="1"&gt;</description></item><item><title>re: LINQ to SQL : Start with a good foundation by defining a custom DataContext</title><link>http://weblogs.asp.net/bschooley/archive/2007/09/28/linq-to-sql-start-with-a-good-foundation-by-defining-a-custom-datacontext.aspx#6247813</link><pubDate>Wed, 04 Jun 2008 16:18:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6247813</guid><dc:creator>Nick Hauenstein</dc:creator><description>&lt;p&gt;@Alan:&lt;/p&gt;
&lt;p&gt;Linq is in System.Core&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6247813" width="1" height="1"&gt;</description></item><item><title>re: LINQ to SQL : Handling disconnected CRUD operations in ASP.Net</title><link>http://weblogs.asp.net/bschooley/archive/2007/09/29/linq-to-sql-handling-disconnected-crud-operations-in-asp-net.aspx#6226921</link><pubDate>Wed, 28 May 2008 17:42:35 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6226921</guid><dc:creator>Thomas Jespersen</dc:creator><description>&lt;p&gt;You don't have to work with disconnected objectes i ASP.NET. When the user posts back changes, then the first thing you do is to featch the latest version of the object form the database (using the id, from the viewstate).&lt;/p&gt;
&lt;p&gt;Then you verify that the timestamp of the fetched object equals the time stamp from your viewstate. If they do, you are set to go. If they don't you can trhow an exception right there, because you know that the update will fail.&lt;/p&gt;
&lt;p&gt;While theis requires an extra roundtrip to the server, this can be a very good aproch if you entity object is more complex. E.g. its an Aggregate which contains other objectes. Also by using this aproach you don't have to send every property to the client, which saves you from checking that the data has not been tampered with (say a usere changes the customer id of an order... how would you detect that)?&lt;/p&gt;
&lt;p&gt;: Thomas&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6226921" width="1" height="1"&gt;</description></item><item><title>re: Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM</title><link>http://weblogs.asp.net/bschooley/archive/2007/11/21/converting-web-site-projects-from-visual-studio-2008-beta-2-to-visual-studio-2008-rtm.aspx#5373911</link><pubDate>Thu, 29 Nov 2007 13:43:01 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5373911</guid><dc:creator>Miguel Domingos</dc:creator><description>&lt;p&gt;I also ran into another issue:&lt;/p&gt;
&lt;p&gt;Change the linq mtehod &amp;quot;ModifiedEntities&amp;quot; to &amp;quot;Inserts&amp;quot;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5373911" width="1" height="1"&gt;</description></item><item><title>VS 2008 Beta 2 to RTM &amp;laquo; Tales from a Trading Desk</title><link>http://weblogs.asp.net/bschooley/archive/2007/11/21/converting-web-site-projects-from-visual-studio-2008-beta-2-to-visual-studio-2008-rtm.aspx#5357325</link><pubDate>Wed, 28 Nov 2007 00:16:46 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5357325</guid><dc:creator>VS 2008 Beta 2 to RTM « Tales from a Trading Desk</dc:creator><description>&lt;p&gt;Pingback from &amp;nbsp;VS 2008 Beta 2 to RTM &amp;amp;laquo; Tales from a Trading Desk&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5357325" width="1" height="1"&gt;</description></item><item><title>re: Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM</title><link>http://weblogs.asp.net/bschooley/archive/2007/11/21/converting-web-site-projects-from-visual-studio-2008-beta-2-to-visual-studio-2008-rtm.aspx#5355482</link><pubDate>Tue, 27 Nov 2007 20:42:43 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5355482</guid><dc:creator>Kevin Fitzgerald</dc:creator><description>&lt;p&gt;Managed to get through all the changes, still have to wonder about the name change from Add to InsertOnSubmit. More wordy yes but explicit, in that case I would expect to see Insert (without submit)?&lt;/p&gt;
&lt;p&gt;I liked the way (since the May 2006 CTP) that I got a collection (ok then an EntitySet) from the designer. Made a lot of sense to Add and Remove from that collection, but the InsertOnSubmit kinda ruins is for me...&lt;/p&gt;
&lt;p&gt;Bah humbug!&lt;/p&gt;
&lt;p&gt;Kev&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5355482" width="1" height="1"&gt;</description></item><item><title>re: Converting web site projects from Visual Studio 2008 Beta 2 to Visual Studio 2008 RTM</title><link>http://weblogs.asp.net/bschooley/archive/2007/11/21/converting-web-site-projects-from-visual-studio-2008-beta-2-to-visual-studio-2008-rtm.aspx#5316667</link><pubDate>Fri, 23 Nov 2007 10:31:52 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5316667</guid><dc:creator>Peter Kassenaar</dc:creator><description>&lt;p&gt;Thanks for sharing! Very valuable stuff.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5316667" width="1" height="1"&gt;</description></item></channel></rss>