Skip to content

How to compare similar column names in two tables

narasiman rao

Asked Jan 31, 2013, 4:04 AM EST1 answer
Share
LinkedInX
I have two tables.

Faculty_Code   Text (Table Name Faculty_Details)

Records in the Faculty_Details as follows;

Faculty_Code 

GS
MK
CK
NR


Another Table (Table Name  Schedule_Details)

Faculty_Code

GS
Mk
SJ
PN

then in the run mode in the combo box all the Faculty_Code from Faculty_Details( table) will display in the combo box.

in combo box  Faculty_Code  as follows from the table  Faculty_Details.

GS
MK
CK
NR

Then i have one button called   View.

when  user select   Faculty_Code GS (the Gs Faculty_Code is there in the both the table) from  the combo box and click the view button.

i want to show the message the select faculty is there.please select different faculty.

how can i show the pop up message using c sharp.

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Hi,

    I understand that you want to compare the
    Faculty_Code of Faculty_Details with Faculty_Code of Schedule_Details.

    If Faculty_Code values exist in Schedule_Details table, you want to show a message that already exist/available.

    If my understanding is correct, Please try the below one,

    Execute this query "
    select count(Faculty_Code) from Schedule_Details where Faculty_Code='GS' ", if the o/p value that is greater than zero, faculty_code exist in second table.
    0