An Ad is connected to a TradeCodeId in the database. So in the AdProvider its possible to select all Ads for a given tradecode, when listing TradeCodes i dont want to print the TradeCodes that arent in use, so i was thinking i could use the AdCollection of the TradeCode object, how do I make this happend? But the AdCollection.Count is always 0, so nothing is printed.
An Ad is connected to a TradeCodeId in the database. So in the AdProvider its possible to select all Ads for a given tradecode, when listing TradeCodes i dont want to print the TradeCodes that arent in use, so i was thinking i could use the AdCollection of the TradeCode object, how do I make this happend? But the AdCollection.Count is always 0, so nothing is printed. Any thoughts?
See code below
TradeCodeDataSource s = new TradeCodeDataSource();
s.Parameters.Add("CategoryID", CategoryID.ToString());
s.SelectMethod = TradeCodeSelectMethod.GetByCategoryID;
TList<TradeCode> tr = (TList<TradeCode>)s.GetEntityList();
TList<TradeCode> List = new TList<TradeCode>();
foreach (TradeCode tc in tr)
{if (tc.AdCollection.Count > 0){List.Add(tc);}}