Dim cmd As New SQLCommandcmd.CommandText = "SELECT 配件名称,sum(库存) AS 库存 From {库存表} group BY 配件名称"
e.form.controls("Label2").text =cmd.ExecuteScalar