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. General Programming
  3. C#
  4. help me!!!!

help me!!!!

Scheduled Pinned Locked Moved C#
helpdatabaseannouncement
2 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
    SEAGames22
    wrote on last edited by
    #1

    This is my code: this.oracleConnection1.ConnectionString = "user id=HMS;data source=HMS2005;password=HMS"; da = new System.Data.OracleClient.OracleDataAdapter(); cmd = new System.Data.OracleClient.OracleCommand("select A1,A2 from TEST",oracleConnection1); da.SelectCommand = cmd; cb = new System.Data.OracleClient.OracleCommandBuilder(da); daset =new DataSet(); da.Fill(daset); daset.Tables[0].Rows[0][0]= "123"; da.Update(daset); So When My program was run . it throw one error and error message is "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." Help me!!!!!!!!!!:doh:

    C 1 Reply Last reply
    0
    • S SEAGames22

      This is my code: this.oracleConnection1.ConnectionString = "user id=HMS;data source=HMS2005;password=HMS"; da = new System.Data.OracleClient.OracleDataAdapter(); cmd = new System.Data.OracleClient.OracleCommand("select A1,A2 from TEST",oracleConnection1); da.SelectCommand = cmd; cb = new System.Data.OracleClient.OracleCommandBuilder(da); daset =new DataSet(); da.Fill(daset); daset.Tables[0].Rows[0][0]= "123"; da.Update(daset); So When My program was run . it throw one error and error message is "Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information." Help me!!!!!!!!!!:doh:

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      You need to add the primary key colums in to the SELECT statement in order for the command builder to generate an UPDATE statement. If you don't do that then it won't know what row to UPDATE.


      My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More

      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