以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]SQLCommand能不能找出指定的行,如TradeID=1034,1035,1036这几个  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=154133)

--  作者:zto001
--  发布时间:2020/9/4 14:54:00
--  [求助]SQLCommand能不能找出指定的行,如TradeID=1034,1035,1036这几个
[求助]SQLCommand能不能找出指定的行,如TradeID=1034,1035,1036这几个

Dim cmd As new SQLCommand
cmd.ConnectionName = "sql"
cmd.CommandText = "Select * From {G_API_TradeList} Where TradeID=\'1034\' or TradeID=\'1035\' or TradeID=\'1036\' "
Dim dt As DataTable = cmd.ExecuteReader(True)

For Each dr As DataRow In dt.DataRows
MessageBox.Show(dr("TradeID"))

Next

--  作者:有点蓝
--  发布时间:2020/9/4 14:59:00
--  
就是这样用,有什么问题?
--  作者:zto001
--  发布时间:2020/9/4 15:05:00
--  
哦哦,没问题了,之前没出来我以为不能用