internal static void SetRowValueFromXmlText(DataRow row, DataColumn col, string xmlText)
{
Debug.Assert(xmlText != null);
Debug.Assert(row.Table.DataSet.EnforceConstraints == false);
object oVal;
try
{
oVal = col.ConvertXmlToObject(xmlText);
// This func does not set the field value to null - call SetRowValueToNull in order to do so
Debug.Assert(oVal != null && !(oVal is DBNull));
}
catch (Exception e) when (Data.Common.ADP.IsCatchableExceptionType(e))
{
// Catch data-type errors and set ROM to Unspecified value
SetRowValueToNull(row, col);
return;
}
if (!oVal.Equals(row[col]))
row[col] = oVal;
}