Data view web part errorsHi,<br><br>I am using Data view web part to display my SQL table on my site. I have also enabled the EDIT and DELETE links ..which r meant to Update and Delete records. <br><br>When i do an EDIT, it shows me an error msg &quot; The Data source control failed to execute the Update command &quot; <br><br>Any suggestions ?...<br>© 2009 Microsoft Corporation. All rights reserved.Tue, 17 Nov 2009 09:28:26 Z08927eec-6cca-4b4a-957c-72dfa1f74e60http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#08927eec-6cca-4b4a-957c-72dfa1f74e60http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#08927eec-6cca-4b4a-957c-72dfa1f74e60Neeraj Shahhttp://social.msdn.microsoft.com/Profile/en-US/?user=Neeraj%20ShahData view web part errorsHi,<br><br>I am using Data view web part to display my SQL table on my site. I have also enabled the EDIT and DELETE links ..which r meant to Update and Delete records. <br><br>When i do an EDIT, it shows me an error msg &quot; The Data source control failed to execute the Update command &quot; <br><br>Any suggestions ?...<br>Wed, 04 Apr 2007 13:36:14 Z2007-04-09T17:55:03Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#54b189ba-7dd0-4548-8f00-aa88e5380c66http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#54b189ba-7dd0-4548-8f00-aa88e5380c66Neeraj Shahhttp://social.msdn.microsoft.com/Profile/en-US/?user=Neeraj%20ShahData view web part errorsI got this one fixed.<br><br> Open  Sharepoint Designer &gt;&gt; Current Data Source <br><br>Right click on each Field names ( row names ) in the right hand side task pane , and Select <br>&quot; Insert as text &quot;. <br><br>Do a &quot;Refresh Data Source&quot; then. <br><br><br>Mon, 09 Apr 2007 17:54:58 Z2007-04-09T17:55:03Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#caece082-d169-4683-8b26-b8c77afcc43fhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#caece082-d169-4683-8b26-b8c77afcc43fSAMSON_1http://social.msdn.microsoft.com/Profile/en-US/?user=SAMSON_1Data view web part errors<p>Hi neeraj, </p> <p> </p> <p>I have followed your steps but its still not working. </p> <p>Any suggestions ?</p> <p> </p> <p>Regards</p> <p>Samson</p>Fri, 20 Apr 2007 10:10:16 Z2007-04-20T10:10:16Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#cabf60a3-6abd-4dd4-883f-62a4220a7ddchttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#cabf60a3-6abd-4dd4-883f-62a4220a7ddcNeeraj Shahhttp://social.msdn.microsoft.com/Profile/en-US/?user=Neeraj%20ShahData view web part errorsHi Samson,<br><br>Guess what, i also encountered the same problem again, even though i did select <br>&quot; Insert as Text &quot;<br><br>The funny thing is that it works some times, and sometimes even i follow the same procedure as i mentioned in my above thread it doesnt work.<br><br>But this is what i have observed....The Update works successfully, if you do an &quot;Insert as Text&quot; as i have mentioned in my above thread,  provided Primary Key field is not included / listed in the form (from which you are doing an Update/Edit) . <br><br>If you include all other fields, except your PK, then Update shuld work.<br><br>However, this wuz not the case when i first worked on it...i wuz able to update PK also....but now the moment i include PK in my form, it shows me &quot; The update action failed&quot; msg<br><br>I am working on it..will post soon..if i figure out a standardized solution.<br><br>Fri, 20 Apr 2007 14:16:49 Z2007-04-20T14:16:49Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#39b145ee-d83c-44d7-a545-f07eaf7dde6ahttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#39b145ee-d83c-44d7-a545-f07eaf7dde6aSAMSON_1http://social.msdn.microsoft.com/Profile/en-US/?user=SAMSON_1Data view web part errors<p>Hi Neeraj, </p> <p> </p> <p>Thanks for the reply. My table has PK(int), Name(nvarchar), Date(datatetime), Duration(int)datatypes. </p> <p>After  primary key is excluded from form</p> <p> Im able to insert new records and the same records im able to edit and delete not the ones which are already there in the database.</p> <p> </p>Mon, 23 Apr 2007 17:08:11 Z2007-04-23T17:08:11Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#5d138405-65bc-4e6a-9eee-b2a83514385ahttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#5d138405-65bc-4e6a-9eee-b2a83514385aNeeraj Shahhttp://social.msdn.microsoft.com/Profile/en-US/?user=Neeraj%20ShahData view web part errorsSamson,<br><br>Did u figure out a way to Update the form with the Primary Key included ?..Is there any solution to tht prb ?<br><br>Neeraj<br>Mon, 23 Apr 2007 17:13:45 Z2007-04-23T17:13:45Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#4d2729c6-453a-433e-90af-5c66cfe0143dhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#4d2729c6-453a-433e-90af-5c66cfe0143dSAMSON_1http://social.msdn.microsoft.com/Profile/en-US/?user=SAMSON_1Data view web part errors<p>Hi Neeraj, </p> <p> </p> <p>Im having problems excluding the primary key as well... If there are any null fields, Im not able to update. Im trying to figure out and I'll let you know abt it</p> <p> </p> <p>Samson</p>Tue, 24 Apr 2007 10:11:15 Z2007-04-24T10:11:15Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#4caaca31-975d-4836-b6b4-24ba2214e87dhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#4caaca31-975d-4836-b6b4-24ba2214e87dNeeraj Shahhttp://social.msdn.microsoft.com/Profile/en-US/?user=Neeraj%20ShahData view web part errorsSamson,...<br><br>Any update from ur side ..regarding doing an Update with the Primary Key included ? <br><br>Neeraj<br>Thu, 26 Apr 2007 13:27:29 Z2007-04-26T13:27:29Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#4ebba89f-823e-4796-a090-eb43735ade40http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#4ebba89f-823e-4796-a090-eb43735ade40ipstrategieshttp://social.msdn.microsoft.com/Profile/en-US/?user=ipstrategiesData view web part errorsany new info on this problem? I ahave a simple table 3 fields insert and delete work fine Update gives error:<span id="ctl00_PlaceHolderMain_LabelMessage">The data source control failed to execute the update command.</span>Tue, 01 May 2007 16:36:11 Z2007-05-01T16:36:11Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#43d8bc25-0b1c-4649-8d0f-e1aff5e589adhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#43d8bc25-0b1c-4649-8d0f-e1aff5e589admjhhttp://social.msdn.microsoft.com/Profile/en-US/?user=mjhData view web part errors<p>Hi,</p> <p> </p> <p>I've been wrestling with this problem for awhile.  I tried eliminating the primary key and it still does not work. I still get the &quot;The data source control failed to execute the update command.&quot;  message</p> <p> </p> <p>Microsoft!!! Help!!! We're wasting too much time on these trivial issues.  How about throwing us a bone and telling us what we're doing wrong.  Also, how about some decent error messages to help us.</p> <p> </p> <p>Mike</p>Tue, 08 May 2007 15:15:58 Z2007-05-08T15:15:58Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#4e9c37a9-4dc1-4b27-92a6-9e2b3e33350ehttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#4e9c37a9-4dc1-4b27-92a6-9e2b3e33350eNeeraj Shahhttp://social.msdn.microsoft.com/Profile/en-US/?user=Neeraj%20ShahData view web part errors<p>Mike,</p> <p> </p> <p>I totally agree with u..this is such  a pain in the neck....I myself wasted 3-4 days on this ***...I dunno if Microsoft is goin to do anything abt this.</p> <p> </p> <p>Well...as for ur problem..did u click on &quot; Insert as Text &quot; option from Sharepoint Designer...it still doesnt work ?</p> <p> </p> <p> </p>Wed, 09 May 2007 14:44:24 Z2007-05-09T14:44:24Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#a3865ef4-03bd-4dcb-b07c-345b1760cd43http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#a3865ef4-03bd-4dcb-b07c-345b1760cd43ipstrategieshttp://social.msdn.microsoft.com/Profile/en-US/?user=ipstrategiesData view web part errorsI tried all suggestions and ended up writing an aspx page to update the table and linked to it in  WSS 3.0.  The client was happy with the solution I was not. I am starting to think it is a permissions problem (possibly between Sharepoint Designer and Sharepoint) because I wrote my own update query and tried it in Sharepoint Designer and it did not work (same error) and used that same update query in the aspx page with no problems.Wed, 09 May 2007 15:40:34 Z2007-05-09T15:40:34Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#57d70d00-ea85-4f22-86c0-ab5d15c00ddchttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#57d70d00-ea85-4f22-86c0-ab5d15c00ddcwuwuhttp://social.msdn.microsoft.com/Profile/en-US/?user=wuwuData view web part errors<p align=left><font face=Arial size=2>Hello,</font></p> <p align=left>are there any solution to this problem.</p> <p align=left>I have just now this problem and i work for two days at this?</p> <p align=left>I hope somebody can help me!!!!</p> <p align=left> </p> <p align=left>Thanks,</p> <p align=left>Horst</p>Tue, 15 Apr 2008 15:47:56 Z2008-04-15T15:47:56Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#df1ee92b-2932-405a-8150-7a1d5deef203http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#df1ee92b-2932-405a-8150-7a1d5deef203Walid Hasanhttp://social.msdn.microsoft.com/Profile/en-US/?user=Walid%20HasanData view web part errors<span style="font-size:x-small;font-family:Calibri"> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small">I had the same problem “The data source control failed to execute the update command”, but after in depth research into the code, I found that the update statement is weird. I modified the update statement, &amp; everything worked just fine after that.</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small">Here is what you need to do to fix that problem:</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small">1. Find the UpdateCommand on the page</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small">You will find a statement that looks like this (UpdateCommand=&quot;UPDATE [Table1] SET [Col1] = @Col1, [Col2] = @Col2 WHERE [Col1] = @original_Col1 AND [Col1] = @original_Col1 AND [Col2] = @original_Col2&quot; …</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small">2. Replace the UpdateCommand with this &quot;UpdateCommand=&quot;UPDATE [Table1] SET [Col1] = @Col1, [Col2] = @Col2 WHERE [Col_PrimaryKey Or Col1] = @original_PrimaryKey &quot;</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small">* Make sure you don't update the Primary Key; you are NOT suppose to update that column. If you do want to update the Primary Key; then, you are better off deleting that row from DB and create new one</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small">3. After you Save the page, make sure the UpdateCommand you modified is NOT changed back to the original one (step 1).</span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small">It worked for me like a charm, Enjoy :)</span></p> <font face=Calibri size=2> <p> </p> </font></span> <p> </p>Mon, 27 Apr 2009 18:03:10 Z2009-04-27T18:03:10Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#1db59948-e5ba-43cf-8133-fbd868bc0e28http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#1db59948-e5ba-43cf-8133-fbd868bc0e28Mike Walsh MVPhttp://social.msdn.microsoft.com/Profile/en-US/?user=Mike%20Walsh%20MVPData view web part errorsSPD Data View web part questions go to the forum for SPD. -&gt; Design/Customization.<br/><br/>Moving this<hr class="sig">WSS FAQ sites: WSS 2.0: <a href="http://wssv2faq.mindsharp.com">http://wssv2faq.mindsharp.com</a> WSS 3.0 and MOSS 2007: <a href="http://wssv3faq.mindsharp.com">http://wssv3faq.mindsharp.com</a> <br/>Total list of WSS 3.0 and MOSS 2007 Books (including foreign language titles) <a href="http://wssv3faq.mindsharp.com/Lists/v3 WSS FAQ/V Books.aspx">http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx</a>Mon, 27 Apr 2009 18:21:39 Z2009-04-27T18:21:39Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#b9a0f0fa-6eb1-4de2-9daa-21cac24bcefehttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#b9a0f0fa-6eb1-4de2-9daa-21cac24bcefegrlynn74http://social.msdn.microsoft.com/Profile/en-US/?user=grlynn74Data view web part errorsWalid, it took me a bit of playing with this as it would not allow me to edit the file directly, but the resolution in my case was similar to what you described.<br/> <br/> 1. select the data view web part<br/> 2. open data source<br/> 3. click &quot;configure database connection&quot;<br/> 4. make sure authentication setup properly and click next <br/> 5. click &quot;specify custom select, update, insert, and delete commands&quot; and hit finish<br/> 6. click the update tab and hit edit command<br/> 7. delete everything past &quot;WHERE [ID] = @original_ID&quot;<br/> <br/> ** This didn't work for me before applying SP2 for Office 2007.<br/> <br/> MS, fix this already!<br/> <br/> Your dataview web part is NOT WORKING.Wed, 10 Jun 2009 14:51:45 Z2009-06-10T14:51:45Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#276ea6af-800a-44fd-9671-2940017f56f8http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#276ea6af-800a-44fd-9671-2940017f56f8Oyesterhttp://social.msdn.microsoft.com/Profile/en-US/?user=OyesterData view web part errorsI too got the same problem. Finally i figured the problem to be with the update and insert statements. <div><br/></div> <div>For update command i ensured the reference of primary Key columns in the where clause.</div> <div>For insert i ensured that all not null columns are included.</div> <div><br/></div> <div>* For delete command even though my command for the dataview webpart is correct i analysed it failed because of a</div> <div>   foriegn key violation.</div> <div><br/></div> <div>After ensuring the above my dataview webpart works perfect.</div>Sat, 04 Jul 2009 10:13:24 Z2009-07-04T10:13:24Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#e6628668-7ac9-47d2-8958-9b15f0a85f9fhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#e6628668-7ac9-47d2-8958-9b15f0a85f9fWesley Groleauhttp://social.msdn.microsoft.com/Profile/en-US/?user=Wesley%20GroleauData view web part errorsEditing the UPDATE and not showing/editing the primary key makes a lot of sense, except...<br/><br/>In my page, there are embedded INSERT, SELECT, and DELETE, but no UPDATE !Thu, 05 Nov 2009 18:06:12 Z2009-11-05T18:06:12Zhttp://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#5878a4d1-c3ab-40f2-8b6d-6b596151d9b9http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomization/thread/08927eec-6cca-4b4a-957c-72dfa1f74e60#5878a4d1-c3ab-40f2-8b6d-6b596151d9b9jasmine jhahttp://social.msdn.microsoft.com/Profile/en-US/?user=jasmine%20jhaData view web part errorsIf the above mention solution doesnt work there is one more step need to be performed after that <br/><br/> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small"><span style="font-size:x-small"><strong>1. Find the UpdateCommand on the page</strong></span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small"><span style="font-size:x-small"><strong>You will find a statement that looks like this (UpdateCommand=&quot;UPDATE [Table1] SET [Col1] = @Col1, [Col2] = @Col2 WHERE [Col1] = @original_Col1 AND [Col1] = @original_Col1 AND [Col2] = @original_Col2&quot; …</strong></span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small"><span style="font-size:x-small"><strong>2. Replace the UpdateCommand with this &quot;UpdateCommand=&quot;UPDATE [Table1] SET [Col1] = @Col1, [Col2] = @Col2 WHERE [Col_PrimaryKey Or Col1] = @original_PrimaryKey &quot;</strong></span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small"><span style="font-size:x-small"><strong>* Make sure you don't update the Primary Key; you are NOT suppose to update that column. If you do want to update the Primary Key; then, you are better off deleting that row from DB and create new one</strong></span></span></p> <p class=MsoNormal style="margin:0in 0in 10pt"><span style="font-size:small"><span style="font-size:x-small"><strong>3. Delete all the parameters in the &lt;UpdateParameters&gt; tag where they start with original_ except the one with Primary Key and Viceversa for Primary key remove the parameters for the same key <br/><br/>for example if CustomerId is the Primary Key<br/>- Keep &lt;asp:parameter id='original_CustomerID'&gt;&lt;/asp:parameter&gt;<br/>remove other original parameters<br/>- Remove &lt;asp:parameter id='CustomerID'&gt;&lt;/asp:parameter&gt;<br/>Keep other parameters which contain modified values to be updates<br/><br/>4. make sure all the above mentioned changes are saved properly<br/><br/>This should work<br/><br/>one more thing some times foreign key contraints also create such kinda issues so beware..<br/><br/><br/>hope this helps<br/><br/>it worked for me .. thank god</strong></span></span></p>Wed, 11 Nov 2009 10:53:26 Z2009-11-11T10:53:52Z