SQl timeouts in IP 2010 - InfoPath Dev
in

InfoPath Dev

SQl timeouts in IP 2010

Last post 09-08-2013 03:14 PM by Patrick Halstead. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 08-30-2013 07:41 AM

    SQl timeouts in IP 2010

    I am getting timeouts against from SQL views because the query is talking more than 30 seconds.

    I found this previous posting on how to increase the timeout

    http://www.infopathdev.com/forums/t/11369.aspx

    However I cant seem to find a solutioon for IP 2010.

    Can someone take the IP2007 info and translate for me to IP 2010?

    Thanks

    Thank you for your Help.

    Art
  • 09-01-2013 01:52 PM In reply to

    Re: SQl timeouts in IP 2010

    While the InfoPath object model did change for 2010, the code should be very similar. I will ask one of our support staff to respond with more detail. 

    Patrick Halstead
    Project Manager at Qdabra
  • 09-01-2013 11:09 PM In reply to

    Re: SQl timeouts in IP 2010

    Hi oldradio99,

    Here's a code you could use for an SQL query connection:

    AdoQueryConnection dc = DataConnections["PutDataConnectionNameHere"] as AdoQueryConnection;
                if (dc != null)
                {
                    dc.Timeout = 300;
                    dc.Execute();
                }

    You might also like to check qRules' QueryData command. It can be used with databases, web services, XMLs, and SharePoint Library Submit connections. What's great about this is that it allows extending the data connection timeout without writing any code. Hope this helps.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 09-03-2013 08:38 AM In reply to

    Re: SQL timeouts in IP 2010

    When I go to set my programming language on the Forms options I only have C# and VB.

     I do not have an Option for JavaScript.

    I found where Hilary posted a VB script so I used this but I get a build error.

    Public

    Sub FormEvents_Loading(ByVal sender As Object, ByVal e As LoadingEventArgs)

    Dim dAdapt

    dAdapt = XDocument.DataAdapters(

    "Main connection")

    dAdapt.Timeout = 120

    'Increase to 60 seconds - Default is 30

    dAdapt.Query()

    'Issue the query

    End Sub

     

     

     

    Thank you for your Help.

    Art
  • 09-03-2013 12:04 PM In reply to

    Re: SQL timeouts in IP 2010

    Made a minor change but now I am getting a message that XDocument is not declared.

    Public Sub FormEvents_Loading(ByVal sender As Object, ByVal e As LoadingEventArgs)

    Dim dAdapt As Object

    dAdapt = XDocument.DataAdapters(

    "Main Connection")

    dAdapt.Timeout = 60

    'Increase to 60 seconds - Default is 30

    dAdapt.Query()

    'Issue the query

    End Sub

    End Class

    Thank you for your Help.

    Art
  • 09-03-2013 09:49 PM In reply to

    Re: SQL timeouts in IP 2010

    Hi oldradio99,

    Sorry for the confusion, the code provided is in C#. VB Script is a bit different with Visual Basic, and the code you're using won't work as a Visual Basic code. I recommend using the previous code in C# for your SQL query connection. Let me know if this helps.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 09-04-2013 06:10 AM In reply to

    Re: SQL timeouts in IP 2010

    Yahoo!  That worked.  Thank you!

    But now have a question.  This change loads the data on form load.  I would prefer the SQL query to run with this time-out extension based on the Run Query Button.

    Where would I insert that code and would the same code work?

    Thanks Again.

    Art

    Thank you for your Help.

    Art
  • 09-04-2013 08:05 AM In reply to

    Re: SQL timeouts in IP 2010

     I think the timeout setting from form load will persist - so try removing the line that executes the query:

     dc.Execute();

    And then running the query from your button.

    Hilary Stoupa

  • 09-04-2013 08:23 AM In reply to

    Re: SQL timeouts in IP 2010

    Thanks
    Thank you for your Help.

    Art
  • 09-06-2013 08:00 AM In reply to

    Re: SQL timeouts in IP 2010

    I did come up with a question.

    When setting the programming language in Form Options it asks for a location.

    Does that location need to be a network location where everyone has access or does it not matter since the code is in the form?

    Thank you for your Help.

    Art
  • 09-08-2013 03:14 PM In reply to

    Re: SQL timeouts in IP 2010

    Local. It will include the DLL in the XSN.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.