MySql.Data.MySqlClient.ResultSet.SetValueObject C# (CSharp) Method

SetValueObject() public method

public SetValueObject ( int i, IMySqlValue valueObject ) : void
i int
valueObject IMySqlValue
return void
        public void SetValueObject(int i, IMySqlValue valueObject)
        {
            Debug.Assert(values != null);
            Debug.Assert(i < values.Length);
            values[i] = valueObject;
        }

Usage Example

コード例 #1
0
        private void AdjustOutputTypes()
        {
            // since MySQL likes to return user variables as strings
            // we reset the types of the readers internal value objects
            // this will allow those value objects to parse the string based
            // return values
            for (int i = 0; i < FieldCount; i++)
            {
                string fieldName = GetName(i);
                fieldName = fieldName.Remove(0, StoredProcedure.ParameterPrefix.Length + 1);
                MySqlParameter parameter = command.Parameters.GetParameterFlexible(fieldName, true);

                IMySqlValue v = MySqlField.GetIMySqlValue(parameter.MySqlDbType);
                if (v is MySqlBit)
                {
                    MySqlBit bit = (MySqlBit)v;
                    bit.ReadAsString = true;
                    resultSet.SetValueObject(i, bit);
                }
                else
                {
                    resultSet.SetValueObject(i, v);
                }
            }
        }
All Usage Examples Of MySql.Data.MySqlClient.ResultSet::SetValueObject