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. Binding picture box with column with oracle

Binding picture box with column with oracle

Scheduled Pinned Locked Moved C#
helpdatabasesql-serveroraclewpf
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.
  • M Offline
    M Offline
    mohammed alherwi
    wrote on last edited by
    #1

    con = new OleDbConnection("provider=oraoledb.oracle.1;user id=scott;password=tiger"); daEmp = new OleDbDataAdapter("select * from emp", con); daDept = new OleDbDataAdapter("select * from dept", con); //---------------------------- ds = new DataSet(); //--------------------------------------- daEmp.Fill(ds, "emp"); dataGridView1.DataSource = ds.Tables["emp"]; //------------------------------------------- daDept.Fill(ds, "dept"); cmbDname.DataSource = ds.Tables["dept"]; cmbDname.DisplayMember = "dname"; cmbDname.ValueMember = "deptno"; //------------------------------------------------- pictureBox1.DataBindings.Add("Image", ds.Tables["emp"], "photo2", true, DataSourceUpdateMode.OnPropertyChanged); txtEmpno.DataBindings.Add("text", ds.Tables["emp"], "empno"); txtEname.DataBindings.Add("text", ds.Tables["emp"], "ename"); txtSal.DataBindings.Add("text", ds.Tables["emp"], "sal"); cmbDname.DataBindings.Add("selectedvalue", ds.Tables["emp"], "deptno"); dtpHireDate.DataBindings.Add("text", ds.Tables["emp"], "hiredate"); txtJob.DataBindings.Add("text", ds.Tables["emp"], "job"); OleDbCommandBuilder cmb = new OleDbCommandBuilder(daEmp); bmb = this.BindingContext[ds.Tables["emp"]]; } Im using the above code to insert picture of employee but when i Try to save it using bmb.EndCurrentEdit(); daEmp.Update(ds.Tables["emp"]); Im getting an error Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information. I have tried to change the data type in Oracle from blob to long raw but Im getting the same issue. Could u plz let me know what is the error Table emp already having primary key The problem occur only when the line binding of picturebox is ther. If i committed the line of picturebox no error the record will be saved. In Sql server I have tried same table and same column it is working. In sql server I declare the column of employee photo as image data type. But in oracle I have tried Long raw and blob data type it is not working

    L 1 Reply Last reply
    0
    • M mohammed alherwi

      con = new OleDbConnection("provider=oraoledb.oracle.1;user id=scott;password=tiger"); daEmp = new OleDbDataAdapter("select * from emp", con); daDept = new OleDbDataAdapter("select * from dept", con); //---------------------------- ds = new DataSet(); //--------------------------------------- daEmp.Fill(ds, "emp"); dataGridView1.DataSource = ds.Tables["emp"]; //------------------------------------------- daDept.Fill(ds, "dept"); cmbDname.DataSource = ds.Tables["dept"]; cmbDname.DisplayMember = "dname"; cmbDname.ValueMember = "deptno"; //------------------------------------------------- pictureBox1.DataBindings.Add("Image", ds.Tables["emp"], "photo2", true, DataSourceUpdateMode.OnPropertyChanged); txtEmpno.DataBindings.Add("text", ds.Tables["emp"], "empno"); txtEname.DataBindings.Add("text", ds.Tables["emp"], "ename"); txtSal.DataBindings.Add("text", ds.Tables["emp"], "sal"); cmbDname.DataBindings.Add("selectedvalue", ds.Tables["emp"], "deptno"); dtpHireDate.DataBindings.Add("text", ds.Tables["emp"], "hiredate"); txtJob.DataBindings.Add("text", ds.Tables["emp"], "job"); OleDbCommandBuilder cmb = new OleDbCommandBuilder(daEmp); bmb = this.BindingContext[ds.Tables["emp"]]; } Im using the above code to insert picture of employee but when i Try to save it using bmb.EndCurrentEdit(); daEmp.Update(ds.Tables["emp"]); Im getting an error Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information. I have tried to change the data type in Oracle from blob to long raw but Im getting the same issue. Could u plz let me know what is the error Table emp already having primary key The problem occur only when the line binding of picturebox is ther. If i committed the line of picturebox no error the record will be saved. In Sql server I have tried same table and same column it is working. In sql server I declare the column of employee photo as image data type. But in oracle I have tried Long raw and blob data type it is not working

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Ask in the Oracle forums; their database, they might know.

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

      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