B
Ben
Hey,
Not sure if this is the right group to post this on, so sorry in
advance if it isn't.
I'm using the VS.NET 2005 beta, and am trying to fill one grid, based
on what is selected in the other grid. So, in the SelectionChanged
event, I get the IDs of the selected rows in the first grid, and..
this is where i get stuck
This is my statement:
SELECT (SELECT Products.Name FROM Products WHERE Products.ID =
Summary.Product) AS Product, SUM(Owned) AS Owned, SUM(Maintained) AS
Maintained, SUM(Unlocked) AS Unlocked,
SUM(Vouchers) AS Vouchers
FROM dbo.Summary
WHERE Summary.Office IN (SELECT Office.ID FROM Office WHERE
Office.Company IN ( @Parameter))
GROUP BY Product
ORDER BY Product
What I would like to be able to do, is replace @Parameter, with
several comma seperated Guid values. However, no matter what I do, if
i try to add a parameter, it gets interpreted as one value, and thus
has some difficulty interpretting something two Guids seperated by a
comma.
Is there a way around this? Or do i have to manually code the this to
use an actual SQL statement rather than trying to use parameters?
Any help would be most appreciated, and I hope I've included enough
detail.
Thanks!
Ben
Not sure if this is the right group to post this on, so sorry in
advance if it isn't.
I'm using the VS.NET 2005 beta, and am trying to fill one grid, based
on what is selected in the other grid. So, in the SelectionChanged
event, I get the IDs of the selected rows in the first grid, and..
this is where i get stuck

This is my statement:
SELECT (SELECT Products.Name FROM Products WHERE Products.ID =
Summary.Product) AS Product, SUM(Owned) AS Owned, SUM(Maintained) AS
Maintained, SUM(Unlocked) AS Unlocked,
SUM(Vouchers) AS Vouchers
FROM dbo.Summary
WHERE Summary.Office IN (SELECT Office.ID FROM Office WHERE
Office.Company IN ( @Parameter))
GROUP BY Product
ORDER BY Product
What I would like to be able to do, is replace @Parameter, with
several comma seperated Guid values. However, no matter what I do, if
i try to add a parameter, it gets interpreted as one value, and thus
has some difficulty interpretting something two Guids seperated by a
comma.
Is there a way around this? Or do i have to manually code the this to
use an actual SQL statement rather than trying to use parameters?
Any help would be most appreciated, and I hope I've included enough
detail.
Thanks!
Ben