Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.

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

Scheduled Pinned Locked Moved Database
csharpdatabasehelpannouncement
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sujit Gupta
    wrote on last edited by
    #1

    n my C# program, I get the following error when trying to write to a table: "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." i use this code : da = new OracleDataAdapter(command, con); da.MissingSchemaAction = MissingSchemaAction.AddWithKey; comB = new OracleCommandBuilder(da); da.Fill(ds, "product"); ds.Tables["product"].PrimaryKey = new System.Data.DataColumn[] { ds.Tables["product"].Columns["item_code"] }; comB.GetUpdateCommand(); da.Update(ds, "product");

    Sujit

    T 1 Reply Last reply
    0
    • S Sujit Gupta

      n my C# program, I get the following error when trying to write to a table: "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." i use this code : da = new OracleDataAdapter(command, con); da.MissingSchemaAction = MissingSchemaAction.AddWithKey; comB = new OracleCommandBuilder(da); da.Fill(ds, "product"); ds.Tables["product"].PrimaryKey = new System.Data.DataColumn[] { ds.Tables["product"].Columns["item_code"] }; comB.GetUpdateCommand(); da.Update(ds, "product");

      Sujit

      T Offline
      T Offline
      Thats Aragon
      wrote on last edited by
      #2

      Hi Sujit! Do you have a primary column defined in the Table? If not then defined it. You must have a primary key defined in your database tables to avoid this error. I hope this will help you. Regards.

      "Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)

      S 1 Reply Last reply
      0
      • T Thats Aragon

        Hi Sujit! Do you have a primary column defined in the Table? If not then defined it. You must have a primary key defined in your database tables to avoid this error. I hope this will help you. Regards.

        "Save water,It's precious" :) "Don't forget to vote" ;) ;P ;)

        S Offline
        S Offline
        Sujit Gupta
        wrote on last edited by
        #3

        Hi friend Basically i have have a product table which have one primary key item_id. i use this statement for fetching data in dataset ( select itemcode,.......... from table) then i make a primary key in dataset on itamcode.after updating all data in dataset. i use da.update(ds) then it generate error. Where i am wrong please suggest me thanks

        Sujit

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups