/// <summary>
/// HTML Decode all string column of string field in a Data Table
/// </summary>
/// <param name="dTable"></param>
/// <param name="fieldName"></param>
/// <returns></returns>
public static DataTable HtmlDecodeDataTable(DataTable dTable)
{
foreach (DataRow drow in dTable.Rows)
{
for (int i = 0; i < drow.ItemArray.Length; i++)
if (drow[i].GetType() == typeof(System.String))
drow[i] = System.Web.HttpUtility.HtmlDecode((drow[i].ToString()));
}
dTable.AcceptChanges();
return dTable;
}
/// HTML Decode all string column of string field in a Data Table
/// </summary>
/// <param name="dTable"></param>
/// <param name="fieldName"></param>
/// <returns></returns>
public static DataTable HtmlDecodeDataTable(DataTable dTable)
{
foreach (DataRow drow in dTable.Rows)
{
for (int i = 0; i < drow.ItemArray.Length; i++)
if (drow[i].GetType() == typeof(System.String))
drow[i] = System.Web.HttpUtility.HtmlDecode((drow[i].ToString()));
}
dTable.AcceptChanges();
return dTable;
}
No comments:
Post a Comment