ok. Maybe there was a missundersting.
I wanted to show data, thats right. yes thats maybe not the right component. so to show data ist not so important.
But the following is important:
I want to select an item in the combobox and then i press a button to save the item to the dataset of my mysql database.
So maybe the customer names are: paul, micha, regina, martin
and i want to change between the different names and save it (via Update table.....)
Or i want a new dataset and i select the item and add also some new information to some Edit fields.
this is my short code for INSERT conbo items to the database. Regina Micha and Martin are names which are only in Customer Table.
ComboMarktteilnehmer.itemindex := comboMarktteilnehmer.items.indexof('Regina');
ComboMarktteilnehmer.itemindex := comboMarktteilnehmer.items.indexof('Micha');
ComboMarktteilnehmer.itemindex := comboMarktteilnehmer.items.indexof('Martin');
intCustomer:= ComboCustomer.ItemIndex;
stringCustomer:= IntToStr (intCustomer);
Form2.connectDB;
Form2.SQLQuery2.SQL.Text := 'SELECT * from customer, sold WHERE customer.customer_id= sold.customer_id';
Form2.SQLQuery2.Open;
Form2.SQLQuery1.SQL.Text := 'INSERT INTO sold (order_ID, customer_id) VALUES ('123','''+stringCustomer+''');
I think there is something wrong with the sql statements.