Grabbing rows from a dataset based on combobox selection

rexehuk

New member
Joined
Jun 3, 2010
Messages
1
Programming Experience
1-3
Hello all, I am a new member of the forums so hopefully I'll find this helpful!

The problem:


I am creating a program that will allow me to manage server EXE's for which I have the method to do so already completed. The problem comes when I want my front end to be able to use a database of different server configs stored in a dataset.

My Database has 4 columns (ServerID | ServerName | ServerPath | ServerMod)

I wish to be able to select the ServerName in a combo box (already done via Datasource/DataMember) and then load the ServerPATH and ServerMOD for that row into two variables.

Any Ideas?
 
As the DataTable is bound to the ComboBox, the SelectedItem will be a DataRowView. You can get any field value from that DataRowView by indexing it by column number or name. The DataRowView can be treated much as you treat the corresponding DataRow from the DataTable. If you actually want that DataRow, you can get it from the Row property of the DataRowView.
 
Back
Top