List<business.clspluginsprp> objprp = new List<business.clspluginsprp>();
business.clsplugins obj = new business.clsplugins();
for (Int32 i = 0; i < k.Length; i++)
{
Int32 z =Convert.ToInt32(k.GetValue(i));
objprp.Add(obj.fnd_plugins(z));
}
GridView2.DataSource = objprp;
GridView2.DataBind();
An error arrived which is as:
The best overloaded method match for 'System.Collections.Generic.List.Add(business.clspluginsprp)' has some invalid arguments while the other error is : Argument 1: cannot convert from 'System.Collections.Generic.List' to 'business.clspluginsprp'
Sumit Kesarwani
26-Aug-2014Try changing this:
objprp.Add(obj.fnd_plugins(z));
to this:
objprp.AddRange(obj.fnd_plugins(z));
Since it seems fnd_plugins returns a list in and of itself. This will also error if fnd_plugins does not return a List generic implementation. Posting the signature of fnd_plugins will help debug this.