예제 #1
0
		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) + "'");
		}
예제 #2
0
		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);
		}