
I have been working on this basic form for a long time and hit my last stumbling block. The following still works: you enter the identifier in the text box, click the "Download" button, select .jpg , then display the image in the image window at the top (in this example, a video camera).
Now for this problem, when you click Save , a method is called with the name updatedata();
I believe that this is the image and identifier of my SQL Server CE database (I did this several times in the bin \ debug folder, and db grew in size). This method also calls a call to another method called Connection();
Now the idea of ββthe connection method is to fill in an ID code based on any elements that were saved in db, so basically every time I add a new image, the selection list should be updated and be available for selection, currently it does nothing, because the code I used was originally written for the corresponding instance of SQL Server, not CE. I tried to reorganize some of them, but now I get the following error.

Here is the code for my connection method:
private void Connection() { //connect to the database and table //selecting all the columns //adding the name column alone to the combobox try { string connstr = @"Data Source=.\TestImage.sdf;Persist Security Info=False;"; SqlCeConnection conn = new SqlCeConnection(connstr); conn.Open(); empadap1 = new SqlDataAdapter(); empadap1.SelectCommand = new SqlCommand("SELECT * FROM test_table" , conn); dset = new DataSet("dset"); empadap1.Fill(dset); DataTable dtable; dtable = dset.Tables[0]; comboBox1.Items.Clear(); foreach (DataRow drow in dtable.Rows) { comboBox1.Items.Add(drow[0].ToString()); comboBox1.SelectedIndex = 0; } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
Question
Can someone change the code of the Connection () method to do what I want (for example, update the drop-down list with all the identifier stored in the SQL Server CE database) or suggest a new code.
Side note
As soon as my combobox is full, I will try to program the "Restore" button based on the selected identifier, which will then display the selected image in the second image window under the first, but I think it's better if I save this separate problem!