I’m using forms and i get names from database to combobox.
(Table Person(idPerson,name,age))
this.personTableAdapter.Fill(this.test_pmDataSet.Person);
How can i get id from person, who i choose in combobox?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
depending on which db you use:
i suppose you have your combobobox populate with the personnames out of your DB
get the name of the person by:
string personsname= combobox1.selectedValue;
Get the id of this person by a query (sql: select idPerson from Persons where name = personsname;)