public void MyDataBind() { Text = new StringBuilder(); foreach (PropertyInfo p in MyDataSource.GetType().GetProperties()) { Text.Append(string.Format("<b>{0}</b>", p.Name)); Text.Append(":"); if (p.GetIndexParameters() == null || p.GetIndexParameters().Length == 0) { Text.Append(p.GetValue(MyDataSource, null)); } Text.Append("<br />"); } }