Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Adding and removing items in collection
Message
From
27/10/2015 04:42:26
 
 
To
26/10/2015 15:14:04
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01626445
Message ID:
01626482
Views:
41
>>From your code it looks as if the collection is actually a Dictionary of arrays.
>>But if that's the case I don't understand the "oInnerJoin.Add(loObject, lnKey, 1)" line - I'd expect
>>oInnerJoin.Add(lnKey,loObject);
>
>The key is the second parameter, not the first one.

But if oInnerJoin is
Dictionary<Tkey,TValue>
then the syntax for adding would be as my code above. That's why I didn't/don't understand your code :-{

>
>>IAC I would look in the collection and, if the key already exists then just modify the value. Only add it if is not already present.
>
>Yes, in this case, as it is an object, I can simply update the object as is, once I get a reference to it from the .Item() method.

So just? :
If loInnerJoin.ContainsKey(key) Then
	loInnerJoin(key) = value
Else
	loInnerJoin.Add(key, value)
End If
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform