D
Duray AKAR
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
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