Dear All,
My requirement is need to pass many parameters with different types using methods in c#.
Get and and set the value of this method.
Like
Get(int a, string name ....................................)
Please recomnd me the best way to use ..
Regards,
Sarava
Please suggest best way to passing parameters in function
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.


Jaish MathewsRank #225 · 11K reputationPosted May 3, 2010, 2:28 AM EDT
Method
public void Test(ParameterCollection coll)
{
Console.WriteLine(coll["First"].DefaultValue);
Console.WriteLine(coll["Second"].DefaultValue);
}
Calling
ParameterCollection coll = new ParameterCollection();
coll.Add("First",System.Data.DbType.Int32,"100");
coll.Add("Second", System.Data.DbType.String, "Jaish Mathews");
Test(coll);
NB: In 2010 you can use Tuples. Look below article
http://www.c-sharpcorner.com/UploadFile/jaishmathews/993/Default.aspx?ArticleID=abfe8998-39d0-4c3e-b0b8-def9a86f2594