Binding picture box with column with oracle

Aug 14 2020 2:38 PM
  1. con = new OleDbConnection("provider=oraoledb.oracle.1;user id=scott;password=tiger");  
  2. daEmp = new OleDbDataAdapter("select * from emp", con);  
  3. daDept = new OleDbDataAdapter("select * from dept", con);  
  4. //----------------------------  
  5. ds = new DataSet();  
  6. //---------------------------------------  
  7. daEmp.Fill(ds, "emp");  
  8. dataGridView1.DataSource = ds.Tables["emp"];  
  9. //-------------------------------------------  
  10. daDept.Fill(ds, "dept");  
  11. cmbDname.DataSource = ds.Tables["dept"];  
  12. cmbDname.DisplayMember = "dname";  
  13. cmbDname.ValueMember = "deptno";  
  14. //-------------------------------------------------  
  15. pictureBox1.DataBindings.Add("Image", ds.Tables["emp"], "photo2"true, DataSourceUpdateMode.OnPropertyChanged);  
  16. txtEmpno.DataBindings.Add("text", ds.Tables["emp"], "empno");  
  17. txtEname.DataBindings.Add("text", ds.Tables["emp"], "ename");  
  18. txtSal.DataBindings.Add("text", ds.Tables["emp"], "sal");  
  19. cmbDname.DataBindings.Add("selectedvalue", ds.Tables["emp"], "deptno");  
  20. dtpHireDate.DataBindings.Add("text", ds.Tables["emp"], "hiredate");  
  21. txtJob.DataBindings.Add("text", ds.Tables["emp"], "job");  
  22. OleDbCommandBuilder cmb = new OleDbCommandBuilder(daEmp);  
  23. bmb = this.BindingContext[ds.Tables["emp"]];  
  24. }  
Im using the above code to insert picture of employee but when i Try to save it using
  1. bmb.EndCurrentEdit();  
  2. 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

Answers (3)