trying to query Sharepoint list but the Web application at "http://sp-wfe" could not be found - InfoPath Dev
in

InfoPath Dev

trying to query Sharepoint list but the Web application at "http://sp-wfe" could not be found

Last post 10-19-2012 01:57 PM by xmlCreator. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 10-19-2012 07:14 AM

    trying to query Sharepoint list but the Web application at "http://sp-wfe" could not be found

    the Web application at "http://sharepoint" could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

    I am developing and running the infopath form on the web server as sharepoint admin. The form has full trust.  I am most certain that I am using the correct URL. It works in powershell just not in code behind.

    can someone verify my code? Thanks

    My code:   

    //set string var

    string assignedTo = "";

    string modifiedBy = "";

    string modifiedDate = "";

    //query SP List and Get Data

    SPSite spSite = new SPSite(http://sp-wfe);

    Using (SPWeb spWeb = spSite.OpenWeb(http://sp-wfe/subsite))

    {

    SPList spList = spWeb.Lists["Tasks"];

    SPQuery spQuery = new SPQuery();

    SPListItemCollection collection = spList.GetItems(spQuery);

    SPListItem spListItem = collection.GetItemById(3);

    assignedTo = spListItem["Assigned To"].ToString();

    modifiedBy = spListItem["Modified By"].ToString();

    modifiedDate = spListItem["Modified"].Tostring();

  • 10-19-2012 09:57 AM In reply to

    Re: trying to query Sharepoint list but the Web application at "http://sp-wfe" could not be found

    xmlCreator:

    SPSite spSite = new SPSite(http://sp-wfe);

    Using (SPWeb spWeb = spSite.OpenWeb(http://sp-wfe/subsite))

    Your URL should be strings, i.e. in quotes (what do you think would be the valur of method parameters passed). 
    Though I do not understand why it is not caught as build/compilation syntax error.

    Also, this code is server-side and will work only from browser, i.e. through IPFS  of enterprise only Sharepoint Server

     

    Gennady Vanin (Novosibirsk) --- Геннадий Ванин (Новосибирск)
  • 10-19-2012 01:57 PM In reply to

    Re: trying to query Sharepoint list but the Web application at "http://sp-wfe" could not be found

    sorry about that. They actually are in quotes.  they didnt copy over.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.