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 / December 2004

Tip: Looking for answers? Try searching our database.

How can I add a configuration file to an infopath project

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Duray AKAR - 10 Dec 2004 20:11 GMT
How can I add a configuration file to an infopath project in VS.NET ?

Example:

Install Microsoft Infopath Toolkit for VS.NET
Create an infopath project
Add a class library to your new solution
Add a windows forms to your class library
Reference the class library in your InfoPath project
Add a button to your infopath from
Edit the button click event, initiate and display a new instance of the
form...
Hit F5
Click the button

works perfect...

now...

stop

Go to your windows form
Right clcik the form and go to properties
Go to Dynamic Properties > Advanced > Text
Type a name for your configuration value

Hit F5
Click the button

Error:
System.InvalidOperationException
The key 'frmSearch.Text' does not exist in the appSettings configuration
section.
at System.Configuration.AppSettingsReader.GetValue(String key, Type type)
at InfopathForms.frmSearch.InitializeComponent()
at InfopathForms.frmSearch..ctor()
at InfopathForms.UIManager.SearchYachts()
at InfoPathProject1.InfoPathProject1.btnForm_OnClick(DocActionEvent e) in
d:\duray\test\infopathproject1\formcode.cs:line 50
at
Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

The app config is there but just does not work...

Any ideas ?

PS:
I have web service locations and connection strings in the config uration
files for my business layer and DAL components... I want to use them in
Infopath

PSPS:

I will install my form with an installer, so i can deploy the config file as
well.

_____________________________

Duray AKAR

---

A small key opens big doors.
Matthew Blain \(Serriform\) - 11 Dec 2004 01:42 GMT
You can't use app.config. Here's an old thread in the ugly new google groups
interface...
http://groups-beta.google.com/group/microsoft.public.infopath/browse_thread/thre
ad/db428a3a30cf75ea/d428ad85de373fb7?q=infopath.exe.config


--Matthew Blain
http://tips.serriform.com/
http://www.developingsolutionswithinfopath.com/

> How can I add a configuration file to an infopath project in VS.NET ?
>
[quoted text clipped - 36 lines]
> d:\duray\test\infopathproject1\formcode.cs:line 50
> at

Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnCl
ick(DocActionEvent pEvent)

> The app config is there but just does not work...
>
[quoted text clipped - 17 lines]
>
> A small key opens big doors.
Matthew Blain \(Serriform\) - 11 Dec 2004 21:21 GMT
But (as mentioned in the referenced thread) you can use your own XML files
as a secondary data source.

I'm replying to myself to point out the following cool-looking solution to
the offline problem:

http://jelle.druyts.net/PermaLink.aspx?guid=79de2f23-4e00-4b5e-8001-395f2a6ba23d

"Matthew Blain (Serriform)" <matthewblain@nospam.serriform.com> wrote in
message news:eEPoNMy3EHA.3616@TK2MSFTNGP11.phx.gbl...
> You can't use app.config. Here's an old thread in the ugly new google groups
> interface...

http://groups-beta.google.com/group/microsoft.public.infopath/browse_thread/thre
ad/db428a3a30cf75ea/d428ad85de373fb7?q=infopath.exe.config


> --Matthew Blain
> http://tips.serriform.com/
[quoted text clipped - 40 lines]
> > d:\duray\test\infopathproject1\formcode.cs:line 50
> > at

Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnCl
> ick(DocActionEvent pEvent)
> >
[quoted text clipped - 20 lines]
> >
> > A small key opens big doors.
 
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.