1- There is an error in SqlClientUtility at line 304
//command.Parameters[i].Value = CheckValue(values[i]);
must be replaced by
command.Parameters.Add(CheckValue(values[i]));
2- There is no GetInt16 method in SqlClientUtility calss.
it could be useful :
/// <summary>
/// Attempts to extract the requested column value from a DataRow.
/// </summary>
/// <param name="dataRow">The DataRow to extract the column value from.</param>
/// <param name="columnName">The name of the column to extract the value from.</param>
/// <param name="valueIfNull">The value to return if the requested column value is null or DBNull.Value.</param>
/// <returns>The value contained in the requested column if the value is not null or DBNull.Value, otherwise null.</returns>
public static short GetInt16(DataRow dataRow, string columnName, short valueIfNull)
{
object value = GetObject(dataRow, columnName, null);
if (value != null)
{
if (value is short)
{
return (short) value;
}
else
{
return Int16.Parse(value.ToString());
}
}
else
{
return valueIfNull;
}
}
/// <summary> /// Attempts to extract the requested column value from a SqlDataReader. /// </summary> /// <param name="dataReader">The SqlDataReader to extract the column value from.</param> /// <param name="columnName">The name of the column to extract the value from.</param> /// <param name="valueIfNull">The value to return if the requested column value is null or DBNull.Value.</param> /// <returns>The value contained in the requested column if the value is not null or DBNull.Value, otherwise null.</returns> public static short GetInt16\(SqlDataReader dataReader, string columnName, short valueIfNull\) \{ object value = GetObject\(dataReader, columnName, null\); if \(value \!= null\) \{
if (value is short)
{
return (short)value;
}
else
{
return Int16.Parse(value.ToString());
}
}
else
{
return valueIfNull;
}
}