Example #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);
			}
		}
Example #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) + "'");
			}
		}