"Sadun Sevingen" <b-saduns@ms> wrote in message
news:O%****************@tk2msftngp13.phx.gbl...
but this give collection property to object... i want to access into an
collection in the object...
lets say... i have object A and it has C attribute as collection... i want
to declare get property G to access C
when i wrote
A.G[key]
also i could get A.C[key]
In your A class you need a property to get to your collection first.
public SqlParameterCollection Parameters
{
get
{
return this.pararmeters
}
set
{
this.parameters = value;
}
}
Then the collection class has the indexer
class Parameters
{
// indexer
public SqlParameter Parameter this[string Parameter]
{
get
{
return Command.Parameters[Parameter];
}
set
{
Command.Parameters[Parameter] = value;
}
}
}
SP