My windows form application is about Book Store. I would like to display PO numbers in a ComboBox which didn't have create a Good Received Note.
This is the structure of this two tables.
PO Table-
GRN table
How to change following code?
public void fillPOcombo()
{
DynamicConnection con = new DynamicConnection();
con.mysqlconnection();
con.sqlquery("select PO_No from TBL_PO");
con.dataread();
while (con.datareader.Read())
{
cmbpono.Items.Add((int)con.datareader["PO_NO"]);
}
}
I would say as follows :
Change
con.sqlquery("select PO_No from TBL_PO");
to
con.sqlquery("select PO_No from TBL_PO where PO_No not in (select PO_No from GRN)");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.