Click here to Skip to main content
14,735,181 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a "Description" column and a "categoryCode" column in a table. I have populated the "Description" in a listbox. What I want is that when I click the "Description" in listbox, the richtextbox should populate the related "categoryCode" of the "Description" value and the value should be pulled in richtext box.

Both columns are in same table.
Ex: My rich text box should appear as..

CategoryCode = ??????????

Please give me some ideas.
Posted
Updated 6-Nov-10 7:03am
v2

1 solution

just simeply you can get the selected description

and make a
query="select catergorycode from table where description="+ listBox1.SelectedItem.ToString();
;
then execute the command ; then after that :

while(dr.read()){

richtextbox.text=dr[0].tostring();
}
   

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