<?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>Only Passionate People Win : Typed Dataset</title><link>http://blogs.msdn.com/youngjoo/archive/tags/Typed+Dataset/default.aspx</link><description>Tags: Typed Dataset</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Webcast: Live From Redmond - VB9, Building N-Tier Applications</title><link>http://blogs.msdn.com/youngjoo/archive/2007/05/21/webcast-live-from-redmond-vb9-building-n-tier-applications.aspx</link><pubDate>Tue, 22 May 2007 02:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2777935</guid><dc:creator>youngjoo</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/youngjoo/comments/2777935.aspx</comments><wfw:commentRss>http://blogs.msdn.com/youngjoo/commentrss.aspx?PostID=2777935</wfw:commentRss><description>&lt;P&gt;My second webcast which was a part of the webcast series done by Visual Basic Team called &lt;A class="" href="http://blogs.msdn.com/vbteam/archive/2007/04/09/live-from-redmond-webcast-series-beth-massi.aspx" mce_href="http://blogs.msdn.com/vbteam/archive/2007/04/09/live-from-redmond-webcast-series-beth-massi.aspx"&gt;"Live From Redmond" webcasts on Visual Studio "Orcas"&lt;/A&gt;&amp;nbsp;was on building N-Tier application using Visual Studio "Orcas".&amp;nbsp; I gave this webcast a couple of weeks ago and it wasn't until today that on-demand version became available.&amp;nbsp; Sorry to those who have been waiting for the on-demand link and a copy of my slide.&lt;/P&gt;
&lt;P&gt;During this webcast, I described new "Orcas" data features at high-level and built a simple multi-tiered application as a demonstration.&amp;nbsp; Specific topics that I covered include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Hierarchical Update Support in Typed Dataset&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;TableAdapterManager class and TableAdapterManager.UpdateAll() method&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;N-Tier Support in Typed Dataset&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Dataset Designer support to make Typed Dataset N-Tier friendly&lt;/LI&gt;
&lt;LI&gt;How to add custom validation logic to Typed Dataset and apply them through multiple tiers&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;WCF&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;How to create and consume basic WCF service&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;LINQ to Typed Dataset&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;You can watch this webcast on-demand by visiting following Microsoft Events page.&amp;nbsp; Also, a link to my slide deck below.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A class="" href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332486%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e" mce_href="http://www.microsoft.com/events/EventDetails.aspx?CMTYSvcSource=MSCOMMedia&amp;amp;Params=%7eCMTYDataSvcParams%5e%7earg+Name%3d%22ID%22+Value%3d%221032332486%22%2f%5e%7earg+Name%3d%22ProviderID%22+Value%3d%22A6B43178-497C-4225-BA42-DF595171F04C%22%2f%5e%7earg+Name%3d%22lang%22+Value%3d%22en%22%2f%5e%7earg+Name%3d%22cr%22+Value%3d%22US%22%2f%5e%7esParams%5e%7e%2fsParams%5e%7e%2fCMTYDataSvcParams%5e"&gt;On-Demand: Live From Redmond VB9 - Building N-Tier Applications&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A class="" href="http://www.dreamfirst.com/files/presentations/2007/May/LiveFromRedmond/OrcasNTier.zip" mce_href="http://www.dreamfirst.com/files/presentations/2007/May/LiveFromRedmond/OrcasNTier.zip"&gt;Slides&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2777935" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/youngjoo/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/youngjoo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/youngjoo/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://blogs.msdn.com/youngjoo/archive/tags/Visual+Basic/default.aspx">Visual Basic</category><category domain="http://blogs.msdn.com/youngjoo/archive/tags/Typed+Dataset/default.aspx">Typed Dataset</category><category domain="http://blogs.msdn.com/youngjoo/archive/tags/Webcast/default.aspx">Webcast</category></item><item><title>TableAdapter’s RETURN_VALUE mystery</title><link>http://blogs.msdn.com/youngjoo/archive/2006/07/25/678320.aspx</link><pubDate>Wed, 26 Jul 2006 02:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:678320</guid><dc:creator>youngjoo</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/youngjoo/comments/678320.aspx</comments><wfw:commentRss>http://blogs.msdn.com/youngjoo/commentrss.aspx?PostID=678320</wfw:commentRss><description>&lt;P&gt;If you've been trying to figure out why you cannot access the return value when using stored procedures in TableAdapter, here's the answer and the solution for you. &lt;/P&gt;
&lt;P&gt;Assume I added a new query to my TableAdapter via Dataset Designer and named it &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;ReturnSomething&lt;/SPAN&gt;. For this query, I used a simple stored procedure that just returns an integer value. Without looking at the generated code, most people expect the return value of the generated query method to contain the return value of the stored procedure and try something like below: &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-FAMILY: Lucida Console"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Dim&lt;/SPAN&gt; returnValue &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;returnValue = taQuery.ReturnSomething &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;/P&gt;
&lt;P&gt;However, above call results in either compile error or run-time error. The problem is that these query methods actually return something else depending on what option you chose for '&lt;EM&gt;Choose the shape of date returned by the stored procedure&lt;/EM&gt;' dialog when adding your query via TableAdapter Query Configuration Wizard.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN style="TEXT-DECORATION: underline"&gt;Single value&lt;/SPAN&gt;: Query method returns the value of the first column of the first row in the result set returned by SELECT statement in your stored procedure. If SELECT statement returns nothing or if there's no SELECT statement, then the return value is NULL. 
&lt;LI&gt;&lt;SPAN style="TEXT-DECORATION: underline"&gt;No value&lt;/SPAN&gt;: Query method returns the number of rows affected by the stored procedure. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Definitely not the return value from the stored procedure. If you look at the generated code, this all makes sense. Here's the example code for these methods.&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" color=#000000&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: green; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT size=2&gt;''&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: green; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;'' Singe value&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: green; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;''&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Overloads&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Overridable&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; ReturnSomethingSingleValue(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; MyParam &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; System.Nullable(&lt;SPAN style="COLOR: blue"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;)) &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Object&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; returnValue &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Object&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Try&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: red"&gt;returnValue = command.ExecuteScalar&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Finally&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; (previousConnectionState = System.Data.ConnectionState.Closed) &lt;SPAN style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&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; &lt;/SPAN&gt;command.Connection.Close&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Try&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt;&lt;FONT color=#000000&gt; ((returnValue &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Is&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Nothing&lt;/SPAN&gt;&lt;FONT color=#000000&gt;)&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;_&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;OrElse&lt;/SPAN&gt;&lt;FONT color=#000000&gt; (returnValue.GetType &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Is&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;GetType&lt;/SPAN&gt;&lt;FONT color=#000000&gt;(System.DBNull))) &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Nothing&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Else&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;CType&lt;/SPAN&gt;&lt;FONT color=#000000&gt;(returnValue,&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Object&lt;/SPAN&gt;&lt;FONT color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 9pt; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;FONT size=2&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: green; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT size=2&gt;''&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: green; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;'' No value&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face="Lucida Console"&gt;&lt;FONT size=2&gt;&lt;SPAN style="FONT-SIZE: 9pt; COLOR: green; mso-bidi-font-family: 'Times New Roman'; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;''&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 9pt; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Overloads&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Overridable&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt; ReturnSomethingNoValue(&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt; MyParam &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; System.Nullable(&lt;SPAN style="COLOR: blue"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;)) &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt; returnValue &lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Integer&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Try&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: red"&gt;returnValue = command.ExecuteNonQuery&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Finally&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;If&lt;/SPAN&gt; (previousConnectionState = System.Data.ConnectionState.Closed) &lt;SPAN style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&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; &lt;/SPAN&gt;command.Connection.Close&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Try&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt; returnValue&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT face="Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;/P&gt;
&lt;P&gt;Notice that for single value query, &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;ExecuteScalar&lt;/SPAN&gt; method is used and for no value query &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;ExecuteNonQuery&lt;/SPAN&gt; method is used. And both query methods return what corresponding execute methods return. &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;ExecuteScalar&lt;/SPAN&gt; method returns, as described above, the value of the first column of the first row in the result set and &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;ExecuteNonQuery&lt;/SPAN&gt; returns the number of rows affected by the command. &lt;/P&gt;
&lt;P&gt;Ok. It's very comforting to know what these methods return and we now understand where errors come from. But where do we get actual return values from then? If you read through the generated code carefully, you will notice that TableAdapter actually has places for return values.&lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="COLOR: blue"&gt;Private&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Sub&lt;/SPAN&gt;&lt;FONT color=#000000&gt; InitCommandCollection()&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;CType&lt;/SPAN&gt;&lt;FONT color=#000000&gt;(&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Me&lt;/SPAN&gt;&lt;FONT color=#000000&gt;._commandCollection(0),System.Data.SqlClient.SqlCommand).CommandText = &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;"dbo.ReturnSomething"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: blue"&gt;CType&lt;/SPAN&gt;&lt;FONT color=#000000&gt;(&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Me&lt;/SPAN&gt;&lt;FONT color=#000000&gt;._commandCollection(0),System.Data.SqlClient.SqlCommand).Parameters.Add(&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt;&lt;FONT color=#000000&gt; System.Data.SqlClient.SqlParameter(&lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;"@RETURN_VALUE"&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, 10, 0, &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Nothing&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, System.Data.DataRowVersion.Current, &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Nothing&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;""&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;""&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;""&lt;/SPAN&gt;&lt;FONT color=#000000&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;CType&lt;/SPAN&gt;&lt;FONT color=#000000&gt;(&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Me&lt;/SPAN&gt;&lt;FONT color=#000000&gt;._commandCollection(1),System.Data.SqlClient.SqlCommand).CommandText = &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;"dbo.ReturnSomething"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="COLOR: blue"&gt;CType&lt;/SPAN&gt;&lt;FONT color=#000000&gt;(&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Me&lt;/SPAN&gt;&lt;FONT color=#000000&gt;._commandCollection(1),System.Data.SqlClient.SqlCommand).Parameters.Add(&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt;&lt;FONT color=#000000&gt; System.Data.SqlClient.SqlParameter(&lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;"@RETURN_VALUE"&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue, 10, 0, &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Nothing&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, System.Data.DataRowVersion.Current, &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Nothing&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;""&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;""&lt;/SPAN&gt;&lt;FONT color=#000000&gt;, &lt;/FONT&gt;&lt;SPAN style="COLOR: maroon"&gt;""&lt;/SPAN&gt;&lt;FONT color=#000000&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;/P&gt;
&lt;P&gt;As you can see from above code sample, each &lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Lucida Console"&gt;SqlCommand&lt;/SPAN&gt; object has &lt;SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: Lucida Console"&gt;ReturnValue&lt;/SPAN&gt; parameter in its Parameters collection. So, it's just a matter of retrieving these values after you execute your query method. To demonstrate how this can be done, I wrote below code in partial class. Note that this is very simple code sample that has no error handling or validation. It just demonstrates the idea. &lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;SPAN style="FONT-FAMILY: Consolas"&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: blue; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;Namespace&lt;/SPAN&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt; MyDatasetTableAdapters&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Partial&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Class&lt;/SPAN&gt;&lt;FONT color=#000000&gt; QueriesTableAdapter&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Public&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Function&lt;/SPAN&gt;&lt;FONT color=#000000&gt; GetReturnValue(&lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;ByVal&lt;/SPAN&gt;&lt;FONT color=#000000&gt; commandIndex &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Integer&lt;/SPAN&gt;&lt;FONT color=#000000&gt;) &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Object&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&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;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;Return&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Me&lt;/SPAN&gt;&lt;FONT color=#000000&gt;.CommandCollection(commandIndex).Parameters(0).Value&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;End&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: blue; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;End&lt;/SPAN&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Namespace&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;After you add above code to your partial class, you can retrieve return value of specific command by doing something like below. &lt;/P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;&lt;SPAN style="COLOR: blue"&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt;&lt;FONT color=#000000&gt; taQueries &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt;&lt;FONT color=#000000&gt; MyDatasetTableAdapters.QueriesTableAdapter&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt;&lt;FONT color=#000000&gt; returnValue &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Integer&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;SPAN style="COLOR: blue"&gt;Dim&lt;/SPAN&gt;&lt;FONT color=#000000&gt; myInputParam &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;As&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;Integer&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="COLOR: blue; mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt;myInputParam = 999&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt;taQueries = &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;New&lt;/SPAN&gt;&lt;FONT color=#000000&gt; MyDatasetTableAdapters.QueriesTableAdapter()&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt;taQueries.ReturnSomethingSingleValue(myInputParam)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=Code style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-no-proof: yes; mso-fareast-language: EN-US"&gt;&lt;FONT color=#000000&gt;returnValue = taQueries.GetReturnValue(0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;&lt;/P&gt;
&lt;P&gt;Above code will execute the first query method in the &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;commandCollection&lt;/SPAN&gt; and retrieve the return value of the same command via &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;GetReturnValue&lt;/SPAN&gt; method added to the partial class. Notice that 0 is passed as the parameter value for &lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Lucida Console"&gt;GetReturnValue&lt;/SPAN&gt; method to specify that we want to retrieve the return value for the first command in the collection. Yeah, it's ugly. But, again, you get the idea. :) &lt;/P&gt;
&lt;P&gt;Typed Dataset simplifies your data access coding. But there are many things that you might not be able to do using generated Typed Dataset. If you are faced with that situation, look for ways to leverage partial classes to add/modify Typed Dataset behavior. That's exactly why we added partial class in Visual Studio 2005! &lt;/P&gt;
&lt;P&gt;If you have better ways to handle return values, please let me know. See something wrong with above approach? Don't be afraid to send me hate email! :) &lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P&gt;&lt;SMALL&gt;Technorati Tags: &lt;A class=techtag href="http://technorati.com/tag/microsoft" rel=tag&gt;microsoft&lt;/A&gt; &lt;A class=techtag href="http://technorati.com/tag/visual+studio" rel=tag&gt;visual+studio&lt;/A&gt; &lt;A class=techtag href="http://technorati.com/tag/typed+dataset" rel=tag&gt;typed+dataset&lt;/A&gt; &lt;A class=techtag href="http://technorati.com/tag/.net" rel=tag&gt;.net&lt;/A&gt; &lt;A class=techtag href="http://technorati.com/tag/ado.net" rel=tag&gt;ado.net&lt;/A&gt; &lt;/SMALL&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=678320" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/youngjoo/archive/tags/Data/default.aspx">Data</category><category domain="http://blogs.msdn.com/youngjoo/archive/tags/Typed+Dataset/default.aspx">Typed Dataset</category></item></channel></rss>