Afternoon,
I am getting the following error, and cant work out why… Can some one please take a look and let me know where i am going wrong.
Cannot implicitly convert type ‘System.Collections.Generic.List’ to ‘System.Collections.Generic.List’
below is what i am trying to use, to get a list back so i can use it with Amazon. I have tried to remove the .ToList() bit but nothing seems to work. I am calling an MS SQL view “GetASINForUpdateLowPrices” which returns a list back of product ASIN’s
List<string> prodASINs = dc.GetASINForUpdateLowPrices.ToList();
SQL for the view i am using, this may help a little bit more.
SELECT asin
FROM dbo.aboProducts
WHERE (asin NOT IN
(SELECT aboProducts_1.asin
FROM dbo.aboProducts AS aboProducts_1 INNER JOIN
dbo.LowestPrices ON aboProducts_1.asin = dbo.LowestPrices.productAsin
WHERE (dbo.LowestPrices.priceDate >= DATEADD(day, - 1, GETDATE()))))
When you call your GetASINForUpdateLowPrices, it wont directly return
List<string>even if there is only one field in your view. Try the following approach:Visual Studio IntelliSense should suggest you the property name after typing
item.. If the property is not string try to add .ToString() at the end of the property name.Edit: After your comment, it seems like you need to use it as
.Select(item => item.asin.ToString()).