Click here to Skip to main content
15,889,863 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all

In my application my one table contain below information

HTML
OMID  OrderNumber
19     a
20     b


and other table contain

HTML
ODID  OrderNumberRef   ItemName
1      19                x
2      20                y


Now i have to display the Item Name in a combo box.
Please tell me how to do this

Below is the 2 query i tried so far

VB
Select m.OrderFormNo from OrderMaster as m left outer join OrderDetails as n ON m.OMID=n.OMIDFormRef where OrderFormNo='" & cmbOrderNo.SelectedValue.ToString & "'"
'This is for getting the OrderNumber

VB
select i.ItemName from ItemInfo as i left outer join OrderDetails as o on i.IIID=o.IIIDItemRef where 

and this is for getting the items.
but not getting what to write in where clause..
Posted

1 solution

Try:
SQL
SELECT m.OrderNumber, n.ItemName FROM OrderMaster m
JOIN OrderDetails n ON m.OMID=n.OrderNumberRef
WHERE m.OrderNumber = 'a'
 
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