Development Experience

Thursday, February 26, 2015

Assign value of property using by property name in C#

C# you can assign property value by using its name example :

Don't for get to add

using System.Reflection;

 xItem.xInformation.xval.GetType().GetProperty("MyPropertyName").SetValue(xItem.xInformation.xval, valueYouWishToAssign,null);  

No comments:

Post a Comment