Hy
I have a combobox in my program.
In my database client with the same name. The dysplay member of my combo box is FirstName + LastName + MiddleName.
The combobox is set to:
AutoCompletMode to: Suggest
AutoCompletSource to : ListItems.
When i search a client name (2 record of the name client in the database), in my combo box appear only the second client name insertad in database.
How to show all name of my clients?
This is my code for pupulating tha combobox:
Program.Connection.CommandText = "SELECT LastName + ', ' + FirstName + ' ' + IIF(MiddleName, MiddleName,'') AS NumeComplet, ClientId FROM Clients GROUP BY ClientId, LastName, FirstName, MiddleName ORDER BY ClientId";
DataTable Table = new DataTable();
Program.Connection.FillDataTable(Table, true);
cboNumeClient.DataSource = Table;
cboNumeClient.DisplayMember = "NumeComplet";
cboNumeClient.ValueMember = "ClientId";
cboNumeClient.Focus();
Is not a solution to remove the duplicate names from database.
If i use the "Suggest" mode for search a client name, in the list are show the last record added for the same client name.
If i use the arrow to select a client name, in the the list of the combo box are show all my clients, ad when i select one and click outside on a another control, the combo box autoselect the first client with the same name.