简体   繁体   English

获取/从sql server 2008中选择数据到数据gridview

[英]fetching / Select data from sql server 2008 into data gridview

Can anyone help me for database query to display data fetched / selected from Sql Server 2008 into c# Desktop application. 任何人都可以帮我进行数据库查询,以便将从Sql Server 2008中提取/选择的数据显示到c#Desktop应用程序中。 I have attached required table diagram & also data grid view please answer as soon as possible. 我附上了所需的表格图和数据网格视图请尽快回答。 I need to display in gridview is: 我需要在gridview中显示:

  1. Godown id Godown id
  2. Godown Name Godown名字
  3. Type Name 输入名称
  4. Count Name 计数名称
  5. Bags 手袋
  6. lbs per bag 每袋lbs
  7. total lbs 总lbs

diagrams: 图: 在此输入图像描述

在此输入图像描述

I have got answer: 我有答案:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM