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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top