Formular una preguntaFormular una pregunta
 

RespondidaData view web part errors

  • miércoles, 04 de abril de 2007 13:36Neeraj Shah Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hi,

    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.

    When i do an EDIT, it shows me an error msg " The Data source control failed to execute the Update command "

    Any suggestions ?...

Respuestas

  • lunes, 09 de abril de 2007 17:54Neeraj Shah Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    I got this one fixed.

     Open  Sharepoint Designer >> Current Data Source

    Right click on each Field names ( row names ) in the right hand side task pane , and Select
    " Insert as text ".

    Do a "Refresh Data Source" then.


Todas las respuestas

  • lunes, 09 de abril de 2007 17:54Neeraj Shah Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respondida
    I got this one fixed.

     Open  Sharepoint Designer >> Current Data Source

    Right click on each Field names ( row names ) in the right hand side task pane , and Select
    " Insert as text ".

    Do a "Refresh Data Source" then.


  • viernes, 20 de abril de 2007 10:10SAMSON_1 Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Hi neeraj,

     

    I have followed your steps but its still not working.

    Any suggestions ?

     

    Regards

    Samson

  • viernes, 20 de abril de 2007 14:16Neeraj Shah Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Hi Samson,

    Guess what, i also encountered the same problem again, even though i did select
    " Insert as Text "

    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.

    But this is what i have observed....The Update works successfully, if you do an "Insert as Text" 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) .

    If you include all other fields, except your PK, then Update shuld work.

    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 " The update action failed" msg

    I am working on it..will post soon..if i figure out a standardized solution.

  • lunes, 23 de abril de 2007 17:08SAMSON_1 Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Hi Neeraj,

     

    Thanks for the reply. My table has PK(int), Name(nvarchar), Date(datatetime), Duration(int)datatypes.

    After  primary key is excluded from form

     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.

     

  • lunes, 23 de abril de 2007 17:13Neeraj Shah Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Samson,

    Did u figure out a way to Update the form with the Primary Key included ?..Is there any solution to tht prb ?

    Neeraj
  • martes, 24 de abril de 2007 10:11SAMSON_1 Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Hi Neeraj,

     

    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

     

    Samson

  • jueves, 26 de abril de 2007 13:27Neeraj Shah Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Samson,...

    Any update from ur side ..regarding doing an Update with the Primary Key included ?

    Neeraj
  • martes, 01 de mayo de 2007 16:36ipstrategies Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    any new info on this problem? I ahave a simple table 3 fields insert and delete work fine Update gives error:The data source control failed to execute the update command.
  • martes, 08 de mayo de 2007 15:15mjh Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Hi,

     

    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 "The data source control failed to execute the update command."  message

     

    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.

     

    Mike

  • miércoles, 09 de mayo de 2007 14:44Neeraj Shah Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Mike,

     

    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.

     

    Well...as for ur problem..did u click on " Insert as Text " option from Sharepoint Designer...it still doesnt work ?

     

     

  • miércoles, 09 de mayo de 2007 15:40ipstrategies Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    I 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.
  • martes, 15 de abril de 2008 15:47wuwu Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     

    Hello,

    are there any solution to this problem.

    I have just now this problem and i work for two days at this?

    I hope somebody can help me!!!!

     

    Thanks,

    Horst

  • lunes, 27 de abril de 2009 18:03Walid Hasan Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respuesta propuesta

    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, & everything worked just fine after that.

    Here is what you need to do to fix that problem:

    1. Find the UpdateCommand on the page

    You will find a statement that looks like this (UpdateCommand="UPDATE [Table1] SET [Col1] = @Col1, [Col2] = @Col2 WHERE [Col1] = @original_Col1 AND [Col1] = @original_Col1 AND [Col2] = @original_Col2" …

    2. Replace the UpdateCommand with this "UpdateCommand="UPDATE [Table1] SET [Col1] = @Col1, [Col2] = @Col2 WHERE [Col_PrimaryKey Or Col1] = @original_PrimaryKey "

    * 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

    3. After you Save the page, make sure the UpdateCommand you modified is NOT changed back to the original one (step 1).

    It worked for me like a charm, Enjoy :)

     

     

    • Propuesto como respuestagrlynn74 miércoles, 10 de junio de 2009 14:27
    •  
  • lunes, 27 de abril de 2009 18:21Mike Walsh MVPMVP, ModeratorMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    SPD Data View web part questions go to the forum for SPD. -> Design/Customization.

    Moving this
    WSS FAQ sites: WSS 2.0: http://wssv2faq.mindsharp.com WSS 3.0 and MOSS 2007: http://wssv3faq.mindsharp.com
    Total list of WSS 3.0 and MOSS 2007 Books (including foreign language titles) http://wssv3faq.mindsharp.com/Lists/v3%20WSS%20FAQ/V%20Books.aspx
  • miércoles, 10 de junio de 2009 14:51grlynn74 Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respuesta propuesta
    Walid, 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.

    1. select the data view web part
    2. open data source
    3. click "configure database connection"
    4. make sure authentication setup properly and click next
    5. click "specify custom select, update, insert, and delete commands" and hit finish
    6. click the update tab and hit edit command
    7. delete everything past "WHERE [ID] = @original_ID"

    ** This didn't work for me before applying SP2 for Office 2007.

    MS, fix this already!

    Your dataview web part is NOT WORKING.
    • Propuesto como respuestagrlynn74 miércoles, 10 de junio de 2009 14:54
    •  
  • sábado, 04 de julio de 2009 10:13Oyester Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    I too got the same problem. Finally i figured the problem to be with the update and insert statements.

    For update command i ensured the reference of primary Key columns in the where clause.
    For insert i ensured that all not null columns are included.

    * For delete command even though my command for the dataview webpart is correct i analysed it failed because of a
       foriegn key violation.

    After ensuring the above my dataview webpart works perfect.
  • jueves, 05 de noviembre de 2009 18:06Wesley Groleau Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     
    Editing the UPDATE and not showing/editing the primary key makes a lot of sense, except...

    In my page, there are embedded INSERT, SELECT, and DELETE, but no UPDATE !
  • miércoles, 11 de noviembre de 2009 10:53jasmine jha Medallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuarioMedallas del usuario
     Respuesta propuesta
    If the above mention solution doesnt work there is one more step need to be performed after that

    1. Find the UpdateCommand on the page

    You will find a statement that looks like this (UpdateCommand="UPDATE [Table1] SET [Col1] = @Col1, [Col2] = @Col2 WHERE [Col1] = @original_Col1 AND [Col1] = @original_Col1 AND [Col2] = @original_Col2" …

    2. Replace the UpdateCommand with this "UpdateCommand="UPDATE [Table1] SET [Col1] = @Col1, [Col2] = @Col2 WHERE [Col_PrimaryKey Or Col1] = @original_PrimaryKey "

    * 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

    3. Delete all the parameters in the <UpdateParameters> tag where they start with original_ except the one with Primary Key and Viceversa for Primary key remove the parameters for the same key

    for example if CustomerId is the Primary Key
    - Keep <asp:parameter id='original_CustomerID'></asp:parameter>
    remove other original parameters
    - Remove <asp:parameter id='CustomerID'></asp:parameter>
    Keep other parameters which contain modified values to be updates

    4. make sure all the above mentioned changes are saved properly

    This should work

    one more thing some times foreign key contraints also create such kinda issues so beware..


    hope this helps

    it worked for me .. thank god

    • Propuesto como respuestajasmine jha martes, 17 de noviembre de 2009 9:28
    •