【发布时间】:2012-03-14 01:21:24
【问题描述】:
我的 mysql 查询选择了字段(item_code、item_name、item quantity、item_selltype、item_selldetail),但其中一些字段是变体。
Dim sqlConn As String = ("SELECT item_code, item_name, item_quantity, item_selltype, item_selldetail FROM qa_items")
Dim objDataAdapter As New MySqlDataAdapter(sqlConn, objConn)
我假设查询返回:
item_code, item_name, item_quantity, item_selltype, item_selldetail
01 Ball 5 unit 10.52
02 Keyoard 10 unit 50.00
03 Gasoline 5 gallon 70.45
DataGridView 控件看起来是这样的:
Code, Name, Inv, Unit Price, Box Price, Pound Price, Gallon Price
那么我需要在 datagridview 中得到这个结果:
Code, Name, Inv, Unit Price, Box Price, Pound Price, Gallon Price
01 Ball 5 10.52 0 0 0
02 Keyboard 10 50.00 0 0 0
03 Gasoline 5 0 0 0 70.45
我在很多方面搜索了一些可以做到这一点的代码,但我无法成功,求助..
【问题讨论】:
标签: mysql vb.net datagridview populate