[英]How to check if a record exists in the SQL Server database C# winform?
我的Windows窗體應用程序是關於書店。 我想在ComboBox中顯示PO編號,這些編號沒有創建好收到的注釋。
這是這兩個表的結構。
PO表 -
GRN表
如何更改以下代碼?
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"]);
}
}
我想說如下:
更改
con.sqlquery("select PO_No from TBL_PO");
至
con.sqlquery("select PO_No from TBL_PO where PO_No not in (select PO_No from GRN)");
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.