2012-08-11 59 views
3

任何人都可以幫助我的數據庫查詢顯示從Sql Server 2008中獲取/選擇到c#桌面應用程序中的數據。我已附上所需的表格圖&也數據網格視圖請儘快回答。我需要在GridView中顯示爲:抓取/從sql server 2008選擇數據到數據gridview

  1. 貨倉ID
  2. 貨倉名稱
  3. 類型名稱
  4. 伯爵名稱
  5. 袋每袋
  6. 總磅

圖表: enter image description here

enter image description here

回答

0

我已經得到答案:

select 
    g.godown_id, g.godown_name, t.type_name, b.count, r.bags_received, 
    b.lb_per_bag, s.supplier_name 
from 
    tbl_yarn_book b, tbl_godown g, tbl_godown_transaction gt, 
    tbl_yarn_receive r, tbl_yarn_supplier s, tbl_yarn_type t       
where 
    gt.godown_id = g.godown_id 
    and gt.receive_id = r.receive_id 
    and r.book_id = b.book_id 
    and b.type_id = t.type_id 
    and b.supplier_id = s.supplier_id 
+1

參見:[壞習慣踢:使用舊樣式的JOIN(http://sqlblog.com/blogs/aaron_bertrand/archive /2009/10/08/bad-habits-to-kick-using-old-style-joins.aspx) – 2012-08-11 15:12:13

+1

感謝marc_s現在編輯它更容易理解。 – Shaan 2012-08-13 06:20:01