同一门店poi有2台机器,只能更新一行,请老师指教
Dim nms() As String = {"门店poi", "省份", "城市", "区县", "地址"}
Dim t As Table = e.Form.controls("Table1").Table
For n As Integer = 1 To t.Rows.Count - 1
Dim dr As DataRow = DataTables("设备进店").Find("门店poi = '" & t.Rows(n)("门店poi") & "'")
If dr IsNot Nothing Then
For Each c As String In nms
dr(c) = t.Rows(n)(c)
Next
End If
Nex
门店有2台机器的,比如 门店poi: 1227105030,只有一行输入省份
使用find,不管怎么查肯定都返回同一行呀。改为select
老师帮看看错在哪
Dim t As Table = e.Form.controls("Table1").Table
Dim Filter As String = "门店poi = '" & t.Current("门店poi") & "'"
Dim drs As List(Of DataRow) = DataTables("设备进店").Select(Filter)
For Each dr As DataRow In drs
dr("省份") = t.Current("省份")
Next