Copying Data from a Secondary Datasource to a Child Table in a Main Datasource

This code sample documents a block of VB.Net code I had to write recently for retrieving a block of data from a secondary datasource, and then copying that data into a child table of a dataset in the main datasource.    I’ve copied it over as is for my benefit as much as yours – I lost…

2

XPathNavigator Control in VB.NET

VB.NET and probably the other managed code languages uses a new syntax for specifying nodes and traversing XML in a form.   I don’t claim to have a firm grasp on this, I only know what works.   Let’s say you’ve got a field in your form whose value you set via rules or defaults, like a datetime field.  …

0

Custom Task Panes in InfoPath 2007 Using VB.NET

Folks, Just starting to get involved in dealing with VB.NET and VSTA in InfoPath 2007.   A lot of what I’ve taken for granted in InfoPath 2003 and JScript no longer applies.   Take Custom Task Panes for example.   A neat idea, and super-useful.   Doesn’t work the same way in InfoPath 2007.   Well some of it does.   For…

0

Getting Current User in InfoPath 2007 via C#

Folks, Got a little code sample from a fellow watcher of Pashman’s Goldmine (thanks Huseyin) on how to retreive the username of the current user via C# code.  Since all code samples are useful, I’ve posted it below: public void FormEvents_Loading(object sender, LoadingEventArgs e) { string xpath = “/my:oneriForm/my:nameTxt”; string userName1; XPathNavigator field1 = MainDataSource.CreateNavigator().SelectSingleNode(xpath,…

2

Programmatically Launching Another Form from Within a Form

Application.XDocuments.NewFromSolution(urlToXsnFile) or Application.XDocuments.Open(urlToXmlFile)   Your form will need to require full trust in order to use either of these OM methods.   Keep it simple, right? Tim

1

Manipulating Secondary Datasources using C#

Hey folks, Like many of you, I’m being dragged into the land of managed code in order to achieve things that I’ve had oodles of JScript code samples to do for a long time.   The InfoPath Toolkit for VS.NET allows you to write code in either VB or C#; since C# looked more like JScript,…

0

Increasing the TimeOut Value on Database Submit

Folks,    Had an issue recently where a user of one of my solutions had pretty terrible bandwidth to the SQL server where they needed to submit data.   The default timeout value on submits is 30 seconds.   As it turn out, the default for queries too is 30 seconds.   You can reset that value fairly easily…

0

Drop the Solution Version Number in a Field

Simple question, simple answer.   Let’s say you want to tell a user what version of the solution they are using.   Technically the way the InfoPath works they don’t need to worry about that, but let’s just say you wanted to tell them.   The following code shows you how to grab a node and push the…

0

Dynamic Efficient Querying of Large Datasets

Folks, I have done a lot of work with making InfoPath live up to it’s promise of providing an offline experience.  That promise becomes a lot harder to fulfill when you are querying large datasets in your form to populate one dropdown lists or more likely a series of cascading dropdowns.   The issue is that…

0

Jumping Around in a Long Form

Hi Everybody, Hey sometimes you get a long form that requires you to do a lot of scrolling around to get to to the different sections.   I use a lot of tricks with views and/or conditionally hidden sections to make things look like they all fit on one page.  Nevertheless, there are some of you…

1