实际上我是VB.net的新手,我想生成一个代码从数据库中选择2列,其中有8列,
我想为Department获得一列,第二列为将停机时间的总和添加到另一列中,例如按总和分组,我应用了我在表适配器查询构建器中所做的查询,效果很好,
SELECT Cast_number, SUM(Downtime) AS Total_downtime
FROM Utilization
GROUP BY Cast_number
但是当我用该代码对按钮进行编程时,它没有显示求和列
Public Class Form1
Private Sub UtilizationBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles UtilizationBindingNavigatorSaveItem.Click
Me.Validate()
Me.UtilizationBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.WINCC_DATADataSet)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'WINCC_DATADataSet.Utilization' table. You can move, or remove it, as needed.
Me.UtilizationTableAdapter.Fill(Me.WINCC_DATADataSet.Utilization)
End Sub
> *Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
> Me.UtilizationTableAdapter.Group(Me.WINCC_DATADataSet.Utilization)*
End Sub
End Class