Beispiel #1
0
        void IMySqlValue.WriteValue(MySqlStream stream, bool binary, object val, int length)
        {
            string s = Convert.ToDecimal(val).ToString(CultureInfo.InvariantCulture);

            if (binary)
            {
                stream.WriteLenString(s);
            }
            else
            {
                stream.WriteStringNoNull(s);
            }
        }
Beispiel #2
0
        void IMySqlValue.WriteValue(MySqlStream stream, bool binary, object val, int length)
        {
            string s = val.ToString();

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

            if (length > 0)
            {
                v = v.Substring(0, length);
            }

            if (binary)
            {
                stream.WriteLenString(v);
            }
            else
            {
                stream.WriteStringNoNull("'" + EscapeString(v) + "'");
            }
        }