/// <summary>
/// HTML Decode a collection of column names in a Data Table
/// </summary>
/// <param name="dTable"></param>
/// <param name="fieldName"></param>
/// <returns></returns>
public static DataTable HtmlDecodeDataTable(DataTable dTable, List<string> fieldNames)
{
foreach (DataRow drow in dTable.Rows)
{
foreach (string fieldName in fieldNames)
{
if (drow[fieldName] != null && drow[fieldName].GetType().IsEquivalentTo(typeof(string)))
{
drow[fieldName] = System.Web.HttpUtility.HtmlDecode((drow[fieldName].ToString()));
}
}
}
dTable.AcceptChanges();
return dTable;
}
/// HTML Decode a collection of column names in a Data Table
/// </summary>
/// <param name="dTable"></param>
/// <param name="fieldName"></param>
/// <returns></returns>
public static DataTable HtmlDecodeDataTable(DataTable dTable, List<string> fieldNames)
{
foreach (DataRow drow in dTable.Rows)
{
foreach (string fieldName in fieldNames)
{
if (drow[fieldName] != null && drow[fieldName].GetType().IsEquivalentTo(typeof(string)))
{
drow[fieldName] = System.Web.HttpUtility.HtmlDecode((drow[fieldName].ToString()));
}
}
}
dTable.AcceptChanges();
return dTable;
}
No comments:
Post a Comment