c# - Casting Error on FileQueryConnection in Infopath 2013 Code -


i've been working on infopath form migrate infopath 2007 infopath 2013. bind data dropdownlist controls filequeryconnection has been used.

 // retrieve data connection bound manager drop-down list box  filequeryconnection institutionconnection =(filequeryconnection)dataconnections[externalusersdc];  // returned owssvr.dll filter on external users of institution  institutionconnection.filelocation = getfilelocation(currentsite, externalusersguid, externaluserinstitution, institution);  // query data connection fill manager drop-down list box items  institutionconnection.execute(); 

here externalusersdc name of infopath connection file. getfilelocation method gets list physical location works fine expected.

casting error occurs while trying dataconnection filequeryconnection. error message follows;

unable cast object of type 'microsoft.office.infopath.internal.sharepointlistadapterrwqueryadapterhost' type 'microsoft.office.infopath.filequeryconnection

i searched everywhere find reason , failed. if has experience issue, please shed light on path.

try as operator. try cast appropriate type.if casting not possible fail gracefully returning null.

    filequeryconnection institutionconnection =dataconnections[externalusersdc] filequeryconnection;  // returned owssvr.dll filter on external users of institution  institutionconnection.filelocation = getfilelocation(currentsite, externalusersguid, externaluserinstitution, institution);  // query data connection fill manager drop-down list box items  institutionconnection.execute(); 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -