public void SetValue(int i, object value)
{
if ((i < 0) ||
(i > FieldCount))
throw new IndexOutOfRangeException(i.ToString(CultureInfo.InvariantCulture));
// Check to see if value is changing
if (_columnValues[i] == value)
return;
// Validate value
object sqlValue;
if (!_recordSetDefinition[i].Validate(value, out sqlValue))
throw new ArgumentException(
string.Format(
"Cannot set the value of column '{0}' to {1}.",
_recordSetDefinition[i],
value == null ? "null" : "'" + value + "'"),
"value");
_columnValues[i] = sqlValue;
}