【发布时间】:2013-11-08 07:37:22
【问题描述】:
我在GTIDArr 中有字符串数组
让我们说GTID={"CODE1","CODE2","CODE3"}
我想从具有上述 GTID 的以下查询的数据库中获取记录。
因此我做了以下事情:
Dim sqlTransferExcel As String = " select gt.GTID ,gt.TransferDate ,pl.LocationName as FromLocation,Pto.LocationName as ToLocation,gt.TransferedMode ,gt.TransferedDetails ,gt.Remarks ,p.ProductName+case when c.CategoryName IS null then '' else '-'+c.CategoryName end as PName,gd.QtyTransferred " _
& " from dbo.GoodTransferDetails gd Left outer join ProductMaster p on gd.ProductID =p.ProductID " _
& " Left Outer join CategoryMaster c on gd.CategoryID =c.CategoryID " _
& " Left Outer join dbo.GoodTransfer gt on gt.GTID=gd.GTID " _
& " Left Outer join PescaLocation pl on gt.FromPescaLocation =pl.PLID " _
& " Left Outer join PescaLocation Pto on gt.ToPescaLocation =pto.PLID " _
& " where gd.GTID in ( '" & GTIDArr() & "' ) order by p.OrderID "
但它给了我在 where 条件为的最后一行的错误
Error 101 Number of indices is less than the dimension of the number of 被索引的
如何在此查询中包含字符串数组??
【问题讨论】:
标签: c# asp.net .net sql vb.net