InforPath 2013 Casting problem in FileQueryConnection - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

InforPath 2013 Casting problem in FileQueryConnection

Last post 08-05-2015 01:30 AM by Buddhini. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 08-05-2015 01:30 AM

    InforPath 2013 Casting problem in FileQueryConnection

    Hi All, I have used FileQueryConnection for update the data connection withing code behind in InfoPath 2007. FileQueryConnection dataConnection = (FileQueryConnection)DataConnections["DataConnectionFileName"]; dataConnection.FileLocation = GetFileLocation(); // Get and set the file location for update the data source dataConnection.Execute(); This code worked properly in InfoPath 2007. But now I have migrate my form in to InfoPath 2013. But with the code excecution of infopath 2013 this will endup with the below exception. Exception : Unable to cast object of type 'Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterListDataProviderHost' to type 'Microsoft.Office.InfoPath.FileQueryConnection'. Then I have changed the code as below FileQueryConnection dataConnection = (FileQueryConnection)(DataSources["DataConnectionFileName "].QueryConnection); ( Reference : https://msdn.microsoft.com/EN-US/library/office/microsoft.office.infopath.filequeryconnection.aspx ) But in both cases I came-up with the same exception. Exception : Unable to cast object of type 'Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterListDataProviderHost' to type 'Microsoft.Office.InfoPath.FileQueryConnection'. Can you please help me to resolve this issue.
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.