Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
dim cols as string = "来源单号,产品编码"
Dim cs() As String = cols.split(",") '拆分字符串为数组
dim i2 as integer = cs.length '如果是2个参数就写2个问号,3个就写3个问号?
cmd.CommandText = "Select 需求数量,累计数量 from dbo."
& ufnName & "(?,?)"
For i As Integer = 0 To cs.Length - 1 '动态传入参数
cmd.Parameters.Add("@" & cs(i), dr(cs(i)))
Next
如上面函数动态传参时如何实现红色部份变动?
谢谢!
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(",") & ")"