How can I get the connection string for a web query in Aspose? I can see the data connection, I can tell that it is a WebQuery, but I cannot get any information about the URL to which the data connection connects.
Thanks for your posting and using Aspose.Cells.
Please provide us your sample excel file containing your web query and a screenshot highlighting your issue in a red circle for our reference. We will look into it and provide you a sample code. In case, this is a new feature, we will add a request for it in our database to support it in our future versions. Thanks for your cooperation.
I need the connection string (boxed in red on the screenshot). The screenshot is taken from the XLSX file included in this post.
Workbook wb = new Workbook( “WebQuerySample.xlsx”);<o:p></o:p>
ExternalConnectionCollection connections = wb.DataConnections;
int connectionCount = connections.Count;
ExternalConnection connection = null;
for (int i = 0; i < connectionCount; i++)
connection = connections[i];
//Check if the Connection is WebQueryConnection, then retrieve its various properties
if (connection is WebQueryConnection)
WebQueryConnection webQuery = (WebQueryConnection)connection;
Let us know your feedback.