Error in submiting from code behind - InfoPath Dev
in

InfoPath Dev

Error in submiting from code behind

Last post 05-23-2010 06:11 AM by anirudh. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-18-2008 06:37 AM

    Error in submiting from code behind

    Hi i am submitting my form from code behind. I am not writing a code for that.i wrote following code

    Dim submitConnection As FileSubmitConnection = DirectCast(Me.DataConnections("NNGSubmit"), FileSubmitConnection)

    submitConnection.FolderUrl ="http://nrdes-wwint01d:7/NNgTest1"

    submitConnection.Execute()

    But my code is giving following error

    The given key was not present in the dictionary.

    System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
    at System.ThrowHelper.ThrowKeyNotFoundException()
    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
    at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapters.get_Item(String name)
    at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapters.EnsureDataAdapter(String name)
    at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapters.get_Item(String name)
    at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataConnectionCollectionHost.<>c__DisplayClass4.<get_Item>b__3()
    at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.ExecuteOMCallWithExceptions(OMCall d, ExceptionFilter exceptionFilter)

    i think error is here plese help me

    submitConnection.FolderUrl ="http://nrdes-wwint01d:7/NNgTest1"

    Thanks

    Pundya

  • 12-18-2008 07:35 AM In reply to

    Re: Error in submiting from code behind

    Hi there -- double check the name of your submit data connection and verify that it is called 'NNGSubmit", including using the same case.

    Hilary Stoupa

  • 05-23-2010 06:11 AM In reply to

    • anirudh
    • Not Ranked
      Male
    • Joined on 05-19-2010
    • singapore
    • Posts 1

    Re: Error in submiting from code behind

    Hi i got the same error, when i am trying to populate the repeat tables to sharepoint list, System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapters.get_Item(String name) at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapters.EnsureDataAdapter(String name) at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapters.get_Item(String name) at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataConnectionCollectionHost.<>c__DisplayClass4.b__3() at Microsoft.Office.InfoPath.Server.DocumentLifetime.OMExceptionManager.ExecuteOMCallWithExceptions(OMCall d, ExceptionFilter exceptionFilter) I have a event handler in the internal startup fucntion, ((ButtonEvent)EventManager.ControlEvents["Submit"]).Clicked += new ClickedEventHandler(Submit_Clicked); And also the location i am supplying this way, FileSubmitConnection SubmitConnection = (FileSubmitConnection)this.DataConnections["Main submit"]; SubmitConnection.FolderUrl = LibLocation.Substring(0, LibLocation.LastIndexOf("/")); SubmitConnection.Execute(); there is a weird thing happening, when i submit the form for the first time, only the first row of the repeater table is saved, with the above error, then if i save the same form with out closing, i am able to save all the rows to the SP list, Please suggest me what should i do to save all the rows in the first time and not get this error, Thanks in advance :)
    Filed under:
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.