以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  改成有数据源的  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=170760)

--  作者:qazlinle6
--  发布时间:2021/8/6 14:18:00
--  改成有数据源的
Dim dr As DataRow = DataTables("今日金价201609").SQLFind("对账品名=\'" & e.PostValues("对账品名") & "\'And  店名=\'" & e.PostValues("店名") & "\'")
    Dim nms() As String = {"今日金价价格","今日金价价格优恵","今日金价折扣","今日金价金价"}  \'""
    If dr IsNot Nothing Then
        For Each nm As String In nms
            If e.PostValues.ContainsKey(nm) Then
                dr(nm)= e.PostValues(nm)
            End If
        Next
    End If
    dr.Save()

--  作者:有点蓝
--  发布时间:2021/8/6 14:24:00
--  
Dim cmd As new SQLCommand
cmd
.ConnectionName = "数据源名称"
Dim
 dt As DataTable
cmd
.CommandText = "Select * From {今日金价201609} where 对账品名=\'" & e.PostValues("对账品名") & "\'And  店名=\'" & e.PostValues("店名") & "\'"
dt
 = cmd.ExecuteReader(True)
if dt.datarows.count > 0 then
Dim dr As DataRow = dt.datarows(0)
  Dim nms() As String = {"今日金价价格","今日金价价格优恵","今日金价折扣","今日金价金价"}  \'""
        For Each nm As String In nms
            If e.PostValues.ContainsKey(nm) Then
                dr(nm)= e.PostValues(nm)
            End If
        Next
    dr.Save()
end if