WebQuery Türünden Dış Veri Bağlantısı ile Çalışmak
Contents
[
Hide
]
Çalışma Kitabı.DataConnections koleksiyonunu kullanarak herhangi bir türdeki harici veri bağlantısına erişebilirsiniz. Bu türden bir veri bağlantısı WebQuery’dir. Bu makale, WebQuery veri bağlantısıyla nasıl çalışılacağını gösterecektir. Microsoft Excel’de Veri > Web’den menüsünü kullanarak WebQuery veri bağlantısı oluşturabilirsiniz.
WebQuery türündeki Harici Veri Bağlantısı ile Çalışma
Aşağıdaki kod, WebQuery türündeki harici veri bağlantısıyla nasıl çalışılacağını göstermektedir. İndirebileceğiniz örnek excel dosyası kullanılmaktadır. Ayrıca bu kodun konsol çıktısını aşağıda görebilirsiniz.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose import pycore | |
from aspose.cells import Workbook | |
from aspose.cells.externalconnections import WebQueryConnection | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
workbook = Workbook(dataDir + "WebQuerySample.xlsx") | |
connection = workbook.data_connections[0] | |
if connection is WebQueryConnection: | |
webQuery = pycore.cast(WebQueryConnection, connection) | |
print("Web Query URL: " + webQuery.url) |
Konsol Çıkışı
Yukarıdaki kodun örnek excel dosyası‘nın konsol çıktısı aşağıda verilmiştir.
Web Query URL: https://docs.aspose.com/cells/net/