Solved

winform combo relationship

Posted on 2008-10-02
1
133 Views
Last Modified: 2013-12-17
Hi I have two tables 1) student and 2) student_type

I have 2 two combo's (thats the requirement which exists as of now)

When student_type is selected all the students have to be shown in another combo.
Incase the student_type is not selected and student is selected the student_type has to be highlighted.

I have a single query written for this (I cant use datarelations as all the existing use joins)

Select student_id,Student_type_id,Student_name,student_type_desc from student a,student_type b
where b.student_type_id = a.student_type_Id

Can the code be shown for the requirement

currently i bind the following way

comboStudent.Datasource = ds.tables[0];
combostudent.displaymember = student_name;
combostudent.valuemember = student_id
combostudent.selectedIndex = -1
combostudent.sleectedndexchnaged = += new System.EventHandler(this.combostudent_SelectedIndexChanged);

cboType.Datasource = ds.tables[0];
cboType.displaymember =  student_type_desc;
cboType.valuemember =student_type_id
cboType.selectedIndex = -1
cboTypet.sleectedndexchnaged = += new System.EventHandler(this.cboType_selectedindexchanged);
0
Comment
Question by:dotnet0824
1 Comment
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 500 total points
ID: 22629719
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now