Click here to Skip to main content
13,446,191 members (36,475 online)
Rate this:
Please Sign up or sign in to vote.
See more:
In my Item Master following column are exists.

No, Type , Desc , Part No.

On My Invoice form if user select Part no (combo box) , Type & Desc (Text box) should get fill as per selection of Part no (combo box) value.

Can any one give me suggestion

Thanks in advance.
Posted 25-Dec-12 23:36pm
Robot With Defects 26-Dec-12 5:49am
Did you try writing the code to fetch and display in SelectedEventChanged event?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Add event onselectedindexchanged on your combobox.
then in code behind i.e in .vb file


string partno = yourcomboboxname.SelectedItem.Value;

then use this partno to fetch whole row from db.

then add those value to your required text box.

if partno will be unquie then you get single row from database.


SqlDataReader reader = cmd.ExecuteReader("Select from tablename where partno = " +partno;

TextBox1.Text = reader["CoulmnName"];

Use same code in vb WITHOUT ";" :)

Hope this will solve your problem.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02-2016 | 2.8.180314.2 | Last Updated 26 Dec 2012
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100