System.Data.ProviderBase.AbstractDataReader.NextResult C# (CSharp) Method

NextResult() public method

public NextResult ( ) : bool
return bool
		public override bool NextResult()
		{
			CloseCurrentResultSet();

			if ((_command.Behavior & CommandBehavior.SingleResult) != 0) {
				while (CloseCurrentResultSet());
				while (_command.NextResultSet());
				return false;
			}

			try {
				while (_resultSetStack.Count > 0) {
					ResultSet rs = (ResultSet)_resultSetStack.Peek();

					if(!rs.next()) {
						CloseCurrentResultSet();
						continue;
					}

					// must be a ResultSet
					object childRs = rs.getObject(1);
					if (childRs != null) {
						SchemaTable = null;
						_resultSetStack.Push(childRs);
						return true;
					}
				}
			}
			catch (SQLException exp) {
				throw CreateException(exp);
			}
				
			if (_command.NextResultSet()) {
				SchemaTable = null;	
				return true;
			}
			return false;
		}