Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / October 2004

Tip: Looking for answers? Try searching our database.

How to get dynamic data from SQL Server using web services

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Murali Choudari - 20 Jul 2004 08:28 GMT
Hi,
I have a web service, it get's data from the SQL server and displays in
InfoPath UI using web service. I'm able to get the data, whenever user
clicks on the "Run Query".

I don't want like this. If there is any update in the SQL server. Then
InfoPath UI should update automatically(refresh)

Regards,
Murali Choudari.
Steve van Dongen [MSFT] - 20 Jul 2004 09:39 GMT
>Hi,
>I have a web service, it get's data from the SQL server and displays in
[quoted text clipped - 3 lines]
>I don't want like this. If there is any update in the SQL server. Then
>InfoPath UI should update automatically(refresh)

There's no way to push data changes from the server.  I've used a task
pane's setTimeout method to periodically poll the server; however,
note that any changes in the form are lost when you call Query().

Regards.
Steve
--
Please post questions to the newsgroup; everyone benefits.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sample code subject to http://www.microsoft.com/info/cpyright.htm
Murali Choudari - 20 Jul 2004 11:48 GMT
Hi Steve,
If you have any sample script , please send to me.

Murali Choudari

> >Hi,
> >I have a web service, it get's data from the SQL server and displays in
[quoted text clipped - 14 lines]
> This posting is provided "AS IS" with no warranties, and confers no rights.
> Sample code subject to http://www.microsoft.com/info/cpyright.htm
Steve van Dongen [MSFT] - 23 Jul 2004 20:15 GMT
>> >Hi,
>> >I have a web service, it get's data from the SQL server and displays in
[quoted text clipped - 10 lines]
>Hi Steve,
>If you have any sample script , please send to me.

OK, but, I have a fair bit of infrastructure built up in this form,
mainly for supporting user configurable preferences, and I decided to
take some of it out but leave some of it in.  The stuff I have left in
-- anything related to my Globals object -- should be self
explanatory.

setTimeout method
<URL:
http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/setTimeout.asp
/>

--- script.js ---

var Globals = {  ... stuff ... }
var oTaskPane = null;
var gfInitialized = false;

function InitTaskPane()
{
    if (null == oTaskPane)
    {
        if (null == XDocument.View)
            return;
        oTaskPane = XDocument.View.Window.TaskPanes.Item(0);
    }

    if (oTaskPane.HTMLDocument.readyState != "complete")
    {
        return;
    }

    gfInitialized = true;
}

function GetTaskPaneWindow()
{
    if (oTaskPane)
    {
        if (Globals.HasFullTrust)
            return oTaskPane.HTMLWindow;
        else
            return oTaskPane.HTMLDocument.parentWindow;
    }
    return null;
}

// Give the click handler for the Refresh button a valid JScript name
// so that it can also be called from script.
RefreshData = function Refresh::OnClick()
{
    XDocument.Query();

    if (Globals.Preferences.RefreshPeriodically == "T" &&
Globals.Preferences.RefreshInterval)
        GetTaskPaneWindow().StartAutoRefresh();
}

--- taskpane.htm ---

            var XDocument = null;
            var iRefreshTimer = null;
            var fAutoRefresh = false;

            function Init()
            {
                // Save a reference to the XDocument
object.
                XDocument =
window.external.Window.XDocument;

                // Set the initial state of the task
pane contents.   
                XDocument.Extension.InitTaskPane();
            }

            function StartAutoRefresh()
            {
                var iInterval =
XDocument.Extension.Globals.Preferences.RefreshInterval;

                if (isNaN(Number(iInterval)))
                    return false;

                if (iRefreshTimer)
                    clearTimeout(iRefreshTimer);
                iRefreshTimer =
setTimeout("Refresh()", iInterval * 1000);
                fAutoRefresh = true;

                return true;
            }

            function StopAutoRefresh()
            {
                if (iRefreshTimer)
                    clearTimeout(iRefreshTimer);
            }

            function PauseAutoRefresh()
            {
                fAutoRefresh = false;
            }

            function ResumeAutoRefresh()
            {
                fAutoRefresh = true;
            }

            function Refresh()
            {
                if (fAutoRefresh)

XDocument.Extension.RefreshData();
            }

--
Please post questions to the newsgroup; everyone benefits.
This posting is provided "AS IS" with no warranties, and confers no rights.
Sample code subject to http://www.microsoft.com/info/cpyright.htm
sakieboy - 01 Oct 2004 13:13 GMT
Hey Steve,

I'm having a problem pushing the data back to the Web Service using InfoPath.
Getting the 'Update unable to find TableMapping['Table'] or DataTable
'Table'.' for the DataAdapter Update.

It appears (to me) that the XML that I'm attempting to pass back is not in
the format it wants.  How would I check to see if something is actually being
sent back?  And, how would I display it, (although, not sure if this part
will help)?

Thanks

Darryl
dwheeler@jjg.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.