public bool NextResult() { if ((behavior & CommandBehavior.SingleResult) != 0) return false; bool hasMore = command.HasMoreResults(); if (hasMore) result = command.GetCurrentContext(); return hasMore; }
private QueryResult[] InternalResultSetList(int count) { if (count <= 0) throw new ArgumentException("'count' must be > 0"); if (results != null && results.Length != count) { // Dispose all the ResultSet objects currently open. for (int i = 0; i < results.Length; ++i) { results[i].Dispose(); } results = null; } if (results == null) { results = new QueryResult[count]; for (int i = 0; i < count; ++i) { results[i] = new QueryResult(this); } } return results; }
internal DeveelSqlDataReader(DeveelSqlCommand command, QueryResult result, CommandBehavior behavior) { this.command = command; this.behavior = behavior; this.result = result; }
private QueryResult ExecuteQuery(QueryResult result) { if (connection.State != ConnectionState.Open) throw new InvalidOperationException("The connection is in an invalid state."); connection.OnStateChange(ConnectionState.Executing); try { // Execute the query, // Make it into a regular query, IQueryContext context = session.CreateContext(); QueryResult queryRs = new QueryResult(context); queryRs.BeginInsertRow(); queryRs.Update(0, text); DeveelSqlParameterCollection vars = Parameters; for (int i = 0; i < vars.Count; ++i) { DeveelSqlParameter v = vars[i]; if (v != null) { queryRs.SetCurrentRowCell(new ObjectValue(v.Value), i + 1); } } queryRs.InsertRow(); // Execute the query, IQueryContext resps = session.Execute(context); queryRs.Close(); result.ConnectionSetup(resps); return result; } finally { connection.OnStateChange(ConnectionState.Open); } }