<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.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>Data Access and ObjectDataSource Control</title><link>http://forums.asp.net/23.aspx</link><description>Questions and discussions related to using ADO.NET for data access, and the ObjectDataSource control. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=9&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Tableadapter configure wizard not generating update insert commands</title><link>http://forums.asp.net/thread/2184206.aspx</link><pubDate>Wed, 20 Feb 2008 11:36:49 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2184206</guid><dc:creator>swaino</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2184206.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=2184206</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Just re-visited this problem and this quote from the above tutorial highlights the work-around...&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;When working with relational databases, it is common for
    queries to pull their data from multiple, related tables. Correlated subqueries
    and &lt;code&gt;JOIN&lt;/code&gt;s provide two different techniques for
    accessing data from related tables in a query. In previous tutorials we most
    commonly made use of correlated subqueries because the TableAdapter cannot
    auto-generate &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;,
    and &lt;code&gt;DELETE&lt;/code&gt; statements for queries involving &lt;code&gt;JOIN&lt;/code&gt;s. 
    While these values can be provided manually, when
    using ad-hoc SQL statements any customizations will be overwritten when the
    TableAdapter Configuration wizard is completed.&lt;/p&gt;
    
  &lt;p&gt;Fortunately, TableAdapters created using stored
    procedures do not suffer from the same brittleness as those created using
    ad-hoc SQL statements. Therefore, it is feasible to create a TableAdapter whose
    main query uses a &lt;code&gt;JOIN&lt;/code&gt; when using stored
    procedures. In this tutorial we saw how to create such a TableAdapter. We
    started by using a &lt;code&gt;JOIN&lt;/code&gt;-less &lt;code&gt;SELECT&lt;/code&gt; query for the 
    TableAdapter’s main query so that the corresponding insert,
    update, and delete stored procedures would be auto-created. With the
    TableAdapter’s initial configuration complete, we augmented the 
    &lt;code&gt;SelectCommand&lt;/code&gt; stored procedure to use a &lt;code&gt;JOIN&lt;/code&gt; 
    and re-ran the TableAdapter Configuration wizard to
    update the &lt;code&gt;EmployeesDataTable&lt;/code&gt;’s columns.&lt;/p&gt;
    
  &lt;p&gt;Re-running the TableAdapter Configuration wizard
    automatically updated the &lt;code&gt;EmployeesDataTable&lt;/code&gt; columns to reflect 
    the data fields returned by the &lt;code&gt;Employees_Select&lt;/code&gt; stored procedure. 
    Alternatively, we could have added these columns manually to
    the DataTable. We will explore manually adding columns to the DataTable in the
    next tutorial.&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Tableadapter configure wizard not generating update insert commands</title><link>http://forums.asp.net/thread/2142354.aspx</link><pubDate>Wed, 30 Jan 2008 13:57:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2142354</guid><dc:creator>swaino</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2142354.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=2142354</wfw:commentRss><description>&lt;p&gt;Ok thanks, I thought this might be the case but just wanted to confirm.&lt;/p&gt;&lt;p&gt;I was sure I&amp;#39;d created table adapters in the past with JOINs and generated INSERT/UPDATE commands ok?!?&lt;/p&gt;&lt;p&gt;What I might do is create Sprocs just for the insert/delete/update commands.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Tableadapter configure wizard not generating update insert commands</title><link>http://forums.asp.net/thread/2142311.aspx</link><pubDate>Wed, 30 Jan 2008 13:35:45 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2142311</guid><dc:creator>ecbruck</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2142311.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=2142311</wfw:commentRss><description>&lt;p&gt;This most likely has to do with the fact that you&amp;#39;re using joins rather than subqueries. Check out the following tutorial.&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="http://www.asp.net/learn/data-access/tutorial-69-cs.aspx" target="_blank"&gt;http://www.asp.net/learn/data-access/tutorial-69-cs.aspx&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Tableadapter configure wizard not generating update insert commands</title><link>http://forums.asp.net/thread/2142083.aspx</link><pubDate>Wed, 30 Jan 2008 11:06:28 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2142083</guid><dc:creator>swaino</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2142083.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=23&amp;PostID=2142083</wfw:commentRss><description>&lt;p&gt;I have this as my select statement when generating my tableadapter in the configure wizard:&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;b&gt;SELECT&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PurchaseItems.*, Stock.*&lt;br /&gt;FROM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;b&gt;PurchaseItems&lt;/b&gt;&lt;b&gt; INNER JOIN&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/b&gt;&lt;b&gt;Stock&lt;/b&gt;&lt;b&gt; ON &lt;/b&gt;&lt;b&gt;PurchaseItems&lt;/b&gt;&lt;b&gt;.StockItemId = Stock.stkId&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The update/insert/delete statements aren&amp;#39;t being generated even though I&amp;#39;ve ticked the option to auto-generate them on the &amp;#39;advanced options...&amp;#39; box in the wizard.&lt;/p&gt;&lt;p&gt;I&amp;#39;ve done this before where I have had columns from another table in my tableadapter.&lt;/p&gt;&lt;p&gt;So I&amp;#39;m not sure why this isn&amp;#39;t working??&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>