Beispiel #1
0
        private long QueryCurrentVersion()
        {
            var cmd = _factory.CreateCommand(Sql_CurrentVersion);

            try
            {
                cmd.Connection.Open();
                return(Convert.ToInt64(cmd.ExecuteScalar()));
            }
            finally
            {
                cmd.Connection.Close();
            }
        }
Beispiel #2
0
        public DbCommand PrepareCommand(string text, CommandType type)
        {
            DbCommand cmd;
            var       scope = DbScope.Current;

            if (scope != null)
            {
                cmd             = scope.PrepareCommand(this);
                cmd.CommandText = text;
            }
            else
            {
                cmd = _factory.CreateCommand(text);
            }
            cmd.CommandType = type;
            return(cmd);
        }