C
C#2y ago
yumo

❔ Combobox add more text into data

Well my combobox is giving me the values of a table like this:
SqlConnection con567 = new SqlConnection("mydatasourcehere");
SqlCommand xxmd = new SqlCommand("SELECT nome_operador from Operadores", con567);
SqlDataAdapter dat = new SqlDataAdapter();
dat.SelectCommand = xxmd;
DataTable table187 = new DataTable();
dat.Fill(table187);

DataRow itemrow78 = table187.NewRow();
itemrow78[0] = "Selecionar Operador";
table187.Rows.InsertAt(itemrow78, 0);

cmbOperadores.DataSource = table187;
cmbOperadores.DisplayMember = "nome_operador";
SqlConnection con567 = new SqlConnection("mydatasourcehere");
SqlCommand xxmd = new SqlCommand("SELECT nome_operador from Operadores", con567);
SqlDataAdapter dat = new SqlDataAdapter();
dat.SelectCommand = xxmd;
DataTable table187 = new DataTable();
dat.Fill(table187);

DataRow itemrow78 = table187.NewRow();
itemrow78[0] = "Selecionar Operador";
table187.Rows.InsertAt(itemrow78, 0);

cmbOperadores.DataSource = table187;
cmbOperadores.DisplayMember = "nome_operador";
and this is working fine, but now i wanted to when i press that button with the arrow in it, would add to the item selected (Inativa) so it would get the text from the combobox and add (Inativa) . Would love some help i've been trying for the past hour and couldnt get any result
2 Replies
yumo
yumo2y ago
An example: If i selected Maquete from this combobox it would save it on the database as Maquete (Inativa)
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.