locked
Dropdownlist bind ID which is not available in another table RRS feed

  • Question

  • User810354248 posted

    In my asp.net+VB=SQL web i have a gridview and the id for selection is a dropdownmenu named IDtxt

    SQL Table

    TAK

    takid letter        letter_dt                Remarks

    11        123/qa    09/20/2017     

    12        321/qa    09/29/2017       

    13       567/qa    09/30/2017     

    Assign_Tak

    atakid  takid letter        letter_dt                Remarks     

    1          11     123/qa    09/20/2017     

    2          12    321/qa    09/29/2017       

     select tak.takid,assign_tak.takid

    from tak
    Inner join assign_tak on assign_tak.takid=tak.takid

    the above query gives me all both fields data

    i want to display in my dropdownlist (IDtxt) 

    Tak.takid which is not available in assign_tak.tadkid

    Monday, October 2, 2017 3:19 AM

Answers

  • User2119946224 posted

    Hi,

    I am not sure but below code might solve your issue:

    select tak.takid
    		,assign_tak.takid
    from tak
    left join assign_tak on assign_tak.takid = tak.takid 
    where assign_tak.takid is null

    Hope this is what you wanted?

    Regards,

    Hasmukh

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 2, 2017 12:06 PM

All replies

  • User2119946224 posted

    HI, 

    In your query, you are fetching online ID field. Not understand your requirement clearly. Please, can you tell me what exactly you expected from query to find dropdownlist.

    Regards,

    Hasmukh

    Monday, October 2, 2017 7:07 AM
  • User810354248 posted

    Now all Takid are reflected in IDtxt (Dropdownlist) . I want to remove those IDs which are in Assign_Tak.

    for example Tak table is having 11,12,13 Takid

    in Assign_Tak table there is 11, 12 Takid

    in my dropdownlist(Idtxt) i want to show only 13

    Monday, October 2, 2017 10:01 AM
  • User2119946224 posted

    Hi,

    I am not sure but below code might solve your issue:

    select tak.takid
    		,assign_tak.takid
    from tak
    left join assign_tak on assign_tak.takid = tak.takid 
    where assign_tak.takid is null

    Hope this is what you wanted?

    Regards,

    Hasmukh

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, October 2, 2017 12:06 PM