Skip to content

Class ExcelQueryTableCollection

Namespace: OfficeOpenXml.Data.QueryTable
Assembly: EPPlus.dll

A collection of legacy query tables in a worksheet. Also see AddQueryTable(ExcelAddressBase, string, ExcelConnection, string[])

public class ExcelQueryTableCollection : IEnumerable<ExcelQueryTable>, IEnumerable

Inheritance

object ← ExcelQueryTableCollection

Implements

IEnumerable
IEnumerable<ExcelQueryTable>

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Properties

Count

The number of query tables in the collection

public int Count { get; }

Property Value

int

this[int]

The query table index.

public ExcelQueryTable this[int index] { get; }

Property Value

ExcelQueryTable

this[string]

Indexer

public ExcelQueryTable this[string name] { get; }

Property Value

ExcelQueryTable

Methods

Add(ExcelAddressBase, string, ExcelConnection)

Adds a new query table to the collection. Worksheet level query tables are legacy objects and can only be used for older types of connection. For newer types of connections like PowerQuery, use AddQueryTable(ExcelAddressBase, string, ExcelConnection, string[]) instead.

public ExcelQueryTable Add(ExcelAddressBase address, string name, ExcelConnection connection)

Parameters

address ExcelAddressBase

The address

name string

The name of the query table.

connection ExcelConnection

The connection

Returns

ExcelQueryTable

Exceptions

ArgumentException

GetEnumerator()

The enumerator for the collection

public IEnumerator<ExcelQueryTable> GetEnumerator()

Returns

IEnumerator<ExcelQueryTable>

Remove(ExcelQueryTable)

Removes the query table from the collection.

public void Remove(ExcelQueryTable queryTable)

Parameters

queryTable ExcelQueryTable

RemoveAt(int)

Removes the query table at the given index from the collection.

public void RemoveAt(int index)

Parameters

index int