<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.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>ASP.NET Debugging : ADO.NET</title><link>http://blogs.msdn.com/tom/archive/tags/ADO.NET/default.aspx</link><description>Tags: ADO.NET</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Silverlight RIA calling Stored Procedures that don’t return tables</title><link>http://blogs.msdn.com/tom/archive/2009/05/07/silverlight-ria-calling-stored-procedures-that-don-t-return-tables.aspx</link><pubDate>Thu, 07 May 2009 17:07:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9593650</guid><dc:creator>Tom</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/tom/comments/9593650.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tom/commentrss.aspx?PostID=9593650</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tom/rsscomments.aspx?PostID=9593650</wfw:comment><description>&lt;p&gt;There are times where you want to use a stored procedure that doesn’t return just normal rows out of a database.&amp;#160; One classic example is if you are doing Full-Text Searching and want to return the Rank.&lt;/p&gt;  &lt;p&gt;The first step to doing this is the get your stored procedures exposed in the ADO.NET Entity Data Model.&amp;#160; Instead of going through the steps for doing that here, I’ll just point you to a great post by Julie Lerman on her blog: &lt;a title="Implement SELECT Stored Procedures that return miscellaneous data in CTP2 of EF Designer" href="http://www.thedatafarm.com/Blog/2007/12/19/ImplementSELECTStoredProceduresThatReturnMiscellaneousDataInCTP2OfEFDesigner.aspx"&gt;Implement SELECT Stored Procedures that return miscellaneous data in CTP2 of EF Designer&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;After following those steps, you will have the stored procedures all ready to be called from the Entity Data Model.&amp;#160; You can then use these stored procedures from ASP.NET, ASP.NET MVC, or anything else that can consume the Entity Data Model.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;One side note, if you use the “Update Model from Database…” feature on your Entity Model, it will destroy the store layer tables that you created from Julie’s post.&amp;#160; If that happens, just recreate them again.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Now to get this to work from Silverlight using RIA, there is another step that needs to be done.&amp;#160; You need to get these stored procedures exposed in your Domain Service.&amp;#160; One way to handle doing that is to create functions in the Domain Service like the following for each of them.&amp;#160; Assume you have a stored procedure called SearchData and it takes a string as input to seach for in the database.&amp;#160; You can create a function in the Domain Service like:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IQueryable&amp;lt;SearchDataTable&amp;gt; GetSearchData(String SearchString)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; Context.SearchData(SearchString).AsQueryable();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;When you compile this, it will create a client side function called LoadSearchData that takes a string as input.&amp;#160; Then you can call this just like you load any other data in Silverlight RIA:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Searching(String search)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (String.IsNullOrEmpty(search))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     context.LoadSearchData(search);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     context.Loaded += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventHandler&amp;lt;System.Windows.Ria.Data.LoadedDataEventArgs&amp;gt;(context_Loaded);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; context_Loaded(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, System.Windows.Ria.Data.LoadedDataEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;     var context = sender &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; MyDomainContext;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (SearchDataTable searchData &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; context.SearchDataTable)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;         ... &lt;span style="color: #0000ff"&gt;do&lt;/span&gt; stuff with the data ...&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Notice that I am hooking up to when the context is finished being loaded so that I know the data has been populated.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9593650" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tom/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/tom/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/RIA/default.aspx">RIA</category><category domain="http://blogs.msdn.com/tom/archive/tags/Entity+Data+Model/default.aspx">Entity Data Model</category><category domain="http://blogs.msdn.com/tom/archive/tags/Data+Access/default.aspx">Data Access</category></item><item><title>ASP.NET Troubleshooting</title><link>http://blogs.msdn.com/tom/archive/2009/03/24/asp-net-troubleshooting.aspx</link><pubDate>Tue, 24 Mar 2009 19:31:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9504630</guid><dc:creator>Tom</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/tom/comments/9504630.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tom/commentrss.aspx?PostID=9504630</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tom/rsscomments.aspx?PostID=9504630</wfw:comment><description>&lt;p&gt;So with how long ASP.NET has been out for now, I am really curious to know how people go about tracking down issues in their project.&lt;/p&gt;  &lt;p&gt;I’d like to know things like:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;How do you know there is a problem&lt;/li&gt;    &lt;li&gt;What tools do you use to confirm that the problem really is a problem&lt;/li&gt;    &lt;li&gt;How do you gather data about the problem&lt;/li&gt;    &lt;li&gt;How do you determine if the problem is your code or something else (like the network, hard drive failure, etc)&lt;/li&gt;    &lt;li&gt;If the problem is your code, how do you ensure your fix resolves the problem (how do you test the fix)&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;If there are any others, I’d also like to hear them.&lt;/p&gt;  &lt;p&gt;Also, if you do anything in the Cloud now, I’d love to hear how you troubleshoot that.&amp;#160; And it can be from any cloud service provider.&lt;/p&gt;  &lt;p&gt;And have any of these things changed with some of the new ways to program that have come out.&amp;#160; For example, AJAX, MVC, Silverlight, IE8, jQuery, etc.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9504630" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tom/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/Debugging/default.aspx">Debugging</category><category domain="http://blogs.msdn.com/tom/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://blogs.msdn.com/tom/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/tom/archive/tags/IE8/default.aspx">IE8</category><category domain="http://blogs.msdn.com/tom/archive/tags/MVC/default.aspx">MVC</category><category domain="http://blogs.msdn.com/tom/archive/tags/ADO.NET/default.aspx">ADO.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/Linq/default.aspx">Linq</category><category domain="http://blogs.msdn.com/tom/archive/tags/jQuery/default.aspx">jQuery</category></item><item><title>The PDC this year…</title><link>http://blogs.msdn.com/tom/archive/2008/09/29/the-pdc-this-year.aspx</link><pubDate>Mon, 29 Sep 2008 13:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8966273</guid><dc:creator>Tom</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/tom/comments/8966273.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tom/commentrss.aspx?PostID=8966273</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tom/rsscomments.aspx?PostID=8966273</wfw:comment><description>&lt;p&gt;Not sure how many people are planning on attending the PDC (Professional Developers Conference) this year, but it is going to be a fantastic conference.&lt;/p&gt;  &lt;p&gt;We announced some huge announcements on the PDC web site.&amp;#160; &lt;a href="http://www.microsoftpdc.com/"&gt;http://www.microsoftpdc.com/&lt;/a&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;We have a major lineup of executive &lt;a href="http://www.microsoftpdc.com/Agenda/Speakers.aspx"&gt;keynote speakers&lt;/a&gt;&lt;u&gt;&lt;/u&gt; representing most of the core Microsoft businesses. &lt;/li&gt;    &lt;li&gt;We’ll have 20+ &lt;a href="http://sessions.microsoftpdc.com/public/sessions.aspx"&gt;Windows 7 sessions&lt;/a&gt;&lt;u&gt;&lt;/u&gt;, and we’ll be giving out the &lt;a href="http://microsoftpdc.com/View.aspx?post=91d46819-8472-40ad-a661-2c78acb4018c:8962840&amp;amp;tag=PDC2008"&gt;Win7 bits&lt;/a&gt;&lt;u&gt;&lt;/u&gt;. &lt;/li&gt;    &lt;li&gt;We also announced our in-depth &lt;a href="http://www.microsoftpdc.com/View.aspx?post=91d46819-8472-40ad-a661-2c78acb4018c:8962797&amp;amp;tag=PDC2008"&gt;symposia&lt;/a&gt;&lt;u&gt;&lt;/u&gt; sessions including parallel computing and S+S.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you have any questions about the PDC, feel free to check out the site listed above, or you can &lt;a href="http://www.askthebrain.net/"&gt;&lt;/a&gt;&lt;a href="http://www.askthebrain.net/"&gt;&lt;/a&gt;&lt;a href="http://www.askthebrain.net/"&gt;Ask the Brain&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The conference runs from October 27th to October 30th with the pre-conference on October 26th.&amp;#160; You can see the full agenda &lt;a href="http://microsoftpdc.com/Agenda/"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;We have also &lt;a href="http://channel9.msdn.com/posts/Dan/Countdown-to-PDC-2008-This-is-the-Software--Services-PDC-Plus-a-Hard-Drive-Chock-Full-oBits-is-a-PDC/"&gt;just announced&lt;/a&gt;&lt;u&gt;&lt;/u&gt; that all partners and customers attending the PDC will receive a very special gift this year:&amp;#160; a 160GB external USB2 hard drive with all of the bits!&amp;#160; That is a very cool gift and very useful as well.&amp;#160; I’d love to hear if anyone is going or thinking about going to the PDC!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8966273" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tom/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/tom/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://blogs.msdn.com/tom/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/tom/archive/tags/Vista/default.aspx">Vista</category><category domain="http://blogs.msdn.com/tom/archive/tags/IIS7/default.aspx">IIS7</category><category domain="http://blogs.msdn.com/tom/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/tom/archive/tags/Windows/default.aspx">Windows</category><category domain="http://blogs.msdn.com/tom/archive/tags/IE8/default.aspx">IE8</category><category domain="http://blogs.msdn.com/tom/archive/tags/Live+Mesh/default.aspx">Live Mesh</category><category domain="http://blogs.msdn.com/tom/archive/tags/MVC/default.aspx">MVC</category><category domain="http://blogs.msdn.com/tom/archive/tags/Mobile/default.aspx">Mobile</category><category domain="http://blogs.msdn.com/tom/archive/tags/ADO.NET/default.aspx">ADO.NET</category></item><item><title>Slow performance of a GridView inside an UpdatePanel</title><link>http://blogs.msdn.com/tom/archive/2008/09/15/slow-performance-of-a-gridview-inside-an-updatepanel.aspx</link><pubDate>Mon, 15 Sep 2008 13:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8947099</guid><dc:creator>Tom</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/tom/comments/8947099.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tom/commentrss.aspx?PostID=8947099</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tom/rsscomments.aspx?PostID=8947099</wfw:comment><description>&lt;P&gt;Here is an interesting problem we ran into recently.&amp;nbsp; The customer had a large GridView that was being updated by AJAX inside on UpdatePanel and seeing bad performance.&lt;/P&gt;
&lt;P&gt;The reason is that the Client-Side Javascript has to walk the entire DOM of the Content of the UpdatePanel to tear down the HTML DOM as the Page goes through an Asynchronous update.&lt;/P&gt;
&lt;H3&gt;First Solution&lt;/H3&gt;
&lt;P&gt;To alleviate the Expensive Stack Walks to destroy DOM Elements and its related Time Delay, the developers suggested that we remove the Unnecessary payload from the DOM of the UpdatePanel during an Asynch Postback.&lt;/P&gt;
&lt;P&gt;The Way you would implement this is to:&lt;/P&gt;
&lt;P&gt;1. Hook up an Event handler to the beginRequest Event . &lt;/P&gt;
&lt;P&gt;EX: &lt;/P&gt;&lt;PRE class=code&gt;&amp;lt;script language ="javascript" type ="text/javascript"&amp;gt;&lt;BR&gt;&amp;nbsp; Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(clearDisposableItems)
&amp;lt;/script&amp;gt;&lt;/PRE&gt;
&lt;P&gt;2. Destroy an DOM Elements that you don’t want the Framework to tear down by tearing it down manually.&lt;/P&gt;
&lt;P&gt;EX: &lt;/P&gt;&lt;PRE class=code&gt;function clearDisposableItems( sender , args ) {
  if (Sys.Browser.agent == Sys.Browser.InternetExplorer ) {
    $get('&amp;lt;%=GridViewID.ClientID%&amp;gt;').tBodies[0].removeNode(true);
  } else {
    $get('&amp;lt;%=GridViewID.ClientID%&amp;gt;').innerHTML="";
  }
}&lt;/PRE&gt;
&lt;P&gt;This gave us a slight decrease in the time taken for async Updates, about 3 seconds less.&amp;nbsp; But, we are still far away from the optimal turn-around time of a few seconds.&lt;/P&gt;
&lt;P&gt;In a sample that I setup on my machine using about 500 rows in a GridView,&amp;nbsp; the turn-around times were in the order of sub-seconds when the GridView had text labels instead of textboxes.&lt;/P&gt;
&lt;P&gt;When I changed the text labels to textboxes, there was an exponential jump in the time taken to process the Form even before the request was submitted to the Server.&lt;/P&gt;
&lt;P&gt;Sub-second response times changed to 25 seconds!!&lt;/P&gt;
&lt;P&gt;The main reason for this slow-down is due to the number of Controls that are present in the Grid.&amp;nbsp; We cannot optimize the Javascript to give good performance in this scenario.&lt;/P&gt;
&lt;H3&gt;Alternative methods&lt;/H3&gt;
&lt;P&gt;So what can we do if we need a GridView with controls?&amp;nbsp; Well, the best suggestions are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Enable paging to allow the control to stay smaller but still give all the information required.&lt;/LI&gt;
&lt;LI&gt;Change the UI to allow for an optimal number of rows that give acceptable performance.&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8947099" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tom/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/tom/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://blogs.msdn.com/tom/archive/tags/ADO.NET/default.aspx">ADO.NET</category></item><item><title>Inserting a dynamic column into a DataGrid and sorting by it</title><link>http://blogs.msdn.com/tom/archive/2008/08/06/inserting-a-dynamic-column-into-a-datagrid-and-sorting-by-it.aspx</link><pubDate>Wed, 06 Aug 2008 13:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8834860</guid><dc:creator>Tom</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/tom/comments/8834860.aspx</comments><wfw:commentRss>http://blogs.msdn.com/tom/commentrss.aspx?PostID=8834860</wfw:commentRss><wfw:comment>http://blogs.msdn.com/tom/rsscomments.aspx?PostID=8834860</wfw:comment><description>&lt;p&gt;We recently had a customer that wanted to sort a dynamic column in a DataGrid and so I thought it may be something that others would like to be able to do. &lt;/p&gt;  &lt;p&gt;You get your data for your dynamic column and then do something like below to insert it into an existing DataTable in a DataSet:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; dc &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; DataColumn&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;dc.DataType = System.Type.&lt;span style="color: #0000ff"&gt;GetType&lt;/span&gt;(&lt;span style="color: #006080"&gt;&amp;quot;System.String&amp;quot;&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;dc.Caption = &lt;span style="color: #006080"&gt;&amp;quot;DynColumn&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;dc.ColumnName = &lt;span style="color: #006080"&gt;&amp;quot;DynColumn&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;vServersSet.Tables(0).Columns.Add(dc)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;For&lt;/span&gt; I = 0 &lt;span style="color: #0000ff"&gt;To&lt;/span&gt; vServersSet.Tables(0).Rows.Count - 1&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;Dim&lt;/span&gt; get_value &lt;span style="color: #0000ff"&gt;As&lt;/span&gt; &lt;span style="color: #0000ff"&gt;String&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;    get_value = GetData(I)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;    vServersSet.Tables(0).Rows(I).Item(&lt;span style="color: #006080"&gt;&amp;quot;DynColumn&amp;quot;&lt;/span&gt;) = get_value&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;Next&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now apply sorting:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;vServersSet.Tables(0).DefaultView.Sort = &lt;span style="color: #006080"&gt;&amp;quot;DynColumn Desc&amp;quot;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This way we can sort on our dynamic column in our grid.&amp;#160; To point the Grid to the table, just using something like:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;
  &lt;div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;
    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;DataGrid1.DataSource = vServersSet.Tables(0)&lt;/pre&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;DataGrid1.DataBind()&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8834860" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/tom/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/tom/archive/tags/Code/default.aspx">Code</category><category domain="http://blogs.msdn.com/tom/archive/tags/ADO.NET/default.aspx">ADO.NET</category></item></channel></rss>