-- 作者:ap9709130
-- 发布时间:2015/7/23 16:14:00
--
代码如下:
Dim wlb As DataTable Dim ids As String = "11,12,13,14" Dim cmd As New SQLCommand cmd.C Dim lm As String For Each lmc As DataCol In DataTables("物料信息表").DataCols If lmc.name.StartsWith("别名") = True Then If lm = "" Then lm = lmc.name Else lm = lm & "," & lmc.name End If End If Next lm = lm & ",[_Identify],[产品名称],[保质系数]" cmd.CommandText = "SELECT " & lm & " F rom {物料信息表} where _Identify in (" & ids & ")" wlb = cmd.ExecuteReader() wlb.DataCols.Add("code", Gettype(Integer), "[_Identify]")
Output.show(wlb.DataRows(0)("code"))
If DataTables.Contains("送货单") = False Then Dim dtb As New DataTableBuilder("送货单") dtb.AddDef("产品名称", Gettype(String), 50) dtb.AddDef("货品档案", Gettype(String), 150) dtb.AddDef("供应商", Gettype(String), 150) dtb.AddDef("包装规格", Gettype(String), 150) dtb.AddDef("产品数量", Gettype(Double)) dtb.AddDef("产品销售价", Gettype(Double)) dtb.AddDef("金额", Gettype(Double)) dtb.AddDef("件数", Gettype(String), 20) dtb.AddDef("订单编号", Gettype(String), 200) dtb.AddDef("产品批号", Gettype(String), 200) dtb.AddDef("生产日期", Gettype(Date)) dtb.AddDef("保质期", Gettype(Date)) dtb.AddDef("产品", Gettype(String), 50) dtb.AddDef("标记", Gettype(Integer)) dtb.Build() End If
If Relations.Contains("shs") = False Then Relations.Add("shs",wlb.DataCols("code"),DataTables("送货单").DataCols("标记")) End If
Output.show(wlb.DataRows(0)("code")) 的值是正常的
|