data adapter update error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mustaf Kazi
    New Member
    • Jan 2007
    • 5

    data adapter update error

    hi,

    I tried to update record using data table and dataadapter

    but I get error for line (in edit case)
    daadapter1.upda te(dtTable1)

    the error is
    "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."

    can any one help me out from this.


    Regards

    Mustak
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Have you tried using fill instead? Please provide more info. Thanks.

    Comment

    • channaJ
      New Member
      • Mar 2007
      • 67

      #3
      Originally posted by kenobewan
      Have you tried using fill instead? Please provide more info. Thanks.
      Fill() and Update() methods of the DataAdapter are used for different purposses. You use Fill() method to get a DataSet or a DataTable filled, where as Update() method is used to Update() the database.

      Comment

      • channaJ
        New Member
        • Mar 2007
        • 67

        #4
        Originally posted by Mustaf Kazi
        hi,

        I tried to update record using data table and dataadapter

        but I get error for line (in edit case)
        daadapter1.upda te(dtTable1)

        the error is
        "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information."

        can any one help me out from this.


        Regards

        Mustak
        Hi,

        I think the problem here is you have not set the Update command of the data adapter properly. Check the UpdateCommand of your DataAdapter and the CommandText of your UpdateCommand.

        Comment

        Working...