Dim f1 As String = "[sys_user]='" & e.DataRow("sys_user") & "' and [日龄]>='" & e.DataRow("肉猪日龄_低") & "' and [日龄]<='" & e.DataRow("肉猪日龄_高") & "'"
Dim drs As List(Of DataRow) = DataTables("肉猪信息").sqlselect(f1)
Dim count As Integer = 0
Dim ls As New List(Of Integer)
Do While count < 20
Dim rnd As Integer = Rand.Next(drs.Count)
If ls.Contains(rnd) = False Then
count += 1
drs(rnd)("栋舍") = e.DataRow("原栋舍")
drs(rnd).save
End If
Loop