Click here to Skip to main content
15,917,645 members
Please Sign up or sign in to vote.
1.00/5 (1 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
Comments
Rakesh6906 26-Dec-12 5:49am    
Did you try writing the code to fetch and display in SelectedEventChanged event?

1 solution

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

write

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.


e.g.

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

while(reader.Read)
{
TextBox1.Text = reader["CoulmnName"];
}

Use same code in vb WITHOUT ";" :)

Hope this will solve your problem.....
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900