void IMySqlValue.WriteValue(MySqlStream stream, bool binary, object val, int length) { string v = val.ToString(); if (length > 0) { length = Math.Min(length, v.Length); v = v.Substring(0, length); } if (binary) stream.WriteLenString(v); else stream.WriteStringNoNull("'" + EscapeString(v) + "'"); }
void IMySqlValue.WriteValue(MySqlStream stream, bool binary, object val, int length) { decimal v = Convert.ToDecimal(val); string valStr = v.ToString(CultureInfo.InvariantCulture); if (binary) stream.WriteLenString(valStr); else stream.WriteStringNoNull(valStr); }