Thursday, 31 March 2011

linq to sql printing the data like select * from tablename where columname="test"





you have to use reflection to dynamically read the properties of a class. Or, refer to the below code

foreach (PropertyDescriptor p in TypeDescriptor.GetProperties(myObj))
{
// p.Name gives the name of the property
// p.GetValue(myObj) gives the value of the property
}





No comments:

Post a Comment