Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

AutoComplete and more than one column shown

$
0
0

I am making a textBox with autocomplete. I use a sql read from a DB for both the name and ID.

The textBox shows all the table info and works well.

Now when I select a name I want it to get the ID (for that will be used to pick up data from the other table).

I can easily have it show both name and ID in the textBox (example: 'Smith, John  (832)' with the 832 being the ID field.)

One alternative is to manipulate that textBox.Text and get the 832 from it.

Another alternative is to do a name search on the table but there can be duplicate names.

So how would I find the ID from that textBox? Or is there a better way?

Thanks


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>