1

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-

enter image description here

GRN table

enter image description here

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"]);
        }
}
1
  • Are you able to show us a SQL query that will return what you need? Commented Jun 23, 2018 at 13:09

1 Answer 1

3

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)");
Sign up to request clarification or add additional context in comments.

4 Comments

Thank You very much.This is the exact thing i have needed.
No worries! Oyaāva saādarayaena paiḷaigananavaā !
@mjwills Good one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.