As per your recommendation.
I kept the special block code that you provided
kept the command line intact
added the response write
entered 1 product - the product result was provided
entered 2 products, separated with a comma - no response in the result
it only showed the bottom
SELECT dbo.ix_spc_product.ID, dbo.ix_spc_product.Name, dbo.ix_spc_performance.capacity Capacity, dbo.ix_spc_planogram.Name POGName, dbo.ix_spc_planogram.Desc14 Cluster, CASE WHEN dbo.ix_spc_planogram.DBStatus = 1 THEN 'Live' WHEN dbo.ix_spc_planogram.DBStatus = 2 THEN 'Pending' END Status, CASE WHEN dbo.ix_spc_planogram.Flag4 = 0 THEN 'Non-Promo' WHEN dbo.ix_spc_planogram.Flag4 = 1 THEN 'Promo' END Promo, dbo.ix_spc_planogram.livedate FROM dbo.ix_spc_product INNER JOIN dbo.ix_spc_performance ON dbo.ix_spc_product.DBKey = dbo.ix_spc_performance.DBParentProductKey INNER JOIN dbo.ix_spc_planogram ON dbo.ix_spc_performance.DBParentPlanogramKey = dbo.ix_spc_planogram.DBKey where dbo.ix_spc_planogram.dbstatus IN (1,2) and dbo.ix_spc_product.DBKey in(SELECT dbkey Name FROM IKB.dbo.ix_spc_product WHERE id IN(?)) ORDER BY dbo.ix_spc_product.ID, dbo.ix_spc_planogram.Flag4, dbo.ix_spc_planogram.dbstatus
I don't really know if there's any way of doing this. I think the only solution is to input each product in it's own field.
>I don't really know if there's any way of doing this. I think the only solution is to input each product in it's own field.
It can certainly be done - I do it all the time except I don't use the parameter object. Try doing it with concatenated SQL string instead. Leave my array/loop code in there and then change your Command.Text string to this:
PromoID_cmd.CommandText = "SELECT dbo.ix_spc_product.ID, dbo.ix_spc_product.Name, dbo.ix_spc_performance.capacity Capacity, dbo.ix_spc_planogram.Name POGName, dbo.ix_spc_planogram.Desc14 Cluster, CASE WHEN dbo.ix_spc_planogram.DBStatus = 1 THEN 'Live' WHEN dbo.ix_spc_planogram.DBStatus = 2 THEN 'Pending' END Status, CASE WHEN dbo.ix_spc_planogram.Flag4 = 0 THEN 'Non-Promo' WHEN dbo.ix_spc_planogram.Flag4 = 1 THEN 'Promo' END Promo, dbo.ix_spc_planogram.livedate FROM dbo.ix_spc_product INNER JOIN dbo.ix_spc_performance ON dbo.ix_spc_product.DBKey = dbo.ix_spc_performance.DBParentProductKey INNER JOIN dbo.ix_spc_planogram ON dbo.ix_spc_performance.DBParentPlanogramKey = dbo.ix_spc_planogram.DBKey where dbo.ix_spc_planogram.dbstatus IN (1,2) and dbo.ix_spc_product.DBKey in(SELECT dbkey Name FROM IKB.dbo.ix_spc_product WHERE id IN (" +PromoID__MMColParam + ")) ORDER BY dbo.ix_spc_product.ID, dbo.ix_spc_planogram.Flag4, dbo.ix_spc_planogram.dbstatus"
Then comment out these two line
'PromoID_cmd.Prepared = true
'PromoID_cmd.Parameters.Append PromoID_cmd.CreateParameter("param1", 200, 1, 255, PromoID__MMColParam) ' adVarChar
Then execute and see if that works. If it doesn't post the screen output of the SQL again.