dim cols as string = "来源单号,产品编码"
Dim cs() As String = cols.split(",") '拆分字符串为数组
For i As Integer = 0 To cs.Length - 1 '动态传入参数
cmd.Parameters.Add("@" & cs(i), dr(cs(i)))
s = s & "?,"
Next
cmd.CommandText = "Select 需求数量,累计数量 from dbo." & ufnName & "(" & s.trim(",") & ")"