foreach (DataColumn v in dt.Columns) { sb.Append("sb.Append("<" + v.ColumnName.ToUpper() + ">"); "); sb.Append("sb.Append(info." + v.ColumnName + "); "); sb.Append("sb.Append("</" + v.ColumnName.ToUpper() + ">"); "); }