Getting textbox values from datatable when a certain combox value is selected.

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

I have a form that had 2 textboxes, and 1 combobox. The two texboxes are
disabled by default. I am using the following code to populare the
combobox:
foreach (DataRow rwSecRow in dtSecurity.Rows) {

cbLoginID.Items.Add(rwSecRow[Schema.TblSecurity.colLoginID]);

}

When a user selects an item from the combobox I'd like the two other
textboxes to fill with the data associated with the selected text. My
datatable is called dtSecurity.



CoboName is cbLoginID

UserName texasbox is tbUserName

Password textbox is tbPassword



Any help would be great !



Derek
 
Forgot to mention the datatable has these values

Login_ID
User_Name
Passowrd

Login_Id is what is getting populated and stored in the Login ID: Combobox.

When Login_ID is selected there proper Username/password values are pulled
and appear in textboxes.

Derek
 
Back
Top