Take the 2-minute tour ×  My List is  public
List<BaseHomePage.QueueListItem> QueueDataSource     get {
return this._queueDataSource; }     set { this._queueDataSource
= value; }  and I want to remove the object from the list,my
code is  for (int i = 0; i < _queueDataSource.Count; i++)
object queue = _queueDataSource[i];      if
(objQuery.BranchOutQueue)
this._queueDataSource.Remove(queue);   //Here I want to getting
error  Error : The best overload method match for
system.collections.Generic.List.Remove(BaseHome.QueueList) has
some invalid arguments  share|improve this question  2 Answers 2
up vote 2 down vote accepted  Instead of using object use var.
var queue = _queueDataSource[i];  Or to be specific you can use:
BaseHomePage.QueueListItem queue = _queueDataSource[i];  The
reason you are getting the error is that Remove expects
parameter of the same type as of List, since you are getting the
object retruned in type object its not compatible.
share|improve this answer +1 which we want to pr