public static IntPtr Prepare2(IntPtr db, string query) { IntPtr stmt; #if NETFX_CORE byte[] queryBytes = System.Text.UTF8Encoding.UTF8.GetBytes(query); var r = Prepare2(db, queryBytes, queryBytes.Length, out stmt, IntPtr.Zero); #else var r = Prepare2(db, query, System.Text.UTF8Encoding.UTF8.GetByteCount(query), out stmt, IntPtr.Zero); #endif if (r != Result.OK) { throw SqlServerException.New(r, GetErrmsg(db)); } return(stmt); }
public static NotNullConstraintViolationException New(SqlServerException exception, Base.TableMapping mapping, object obj) { return(new NotNullConstraintViolationException(exception.Result, exception.Message, mapping, obj)); }