Hello
Where is your App.Config located and Do you have any webservice as
Dataconnection. I dont think Only Infopath without webservice would access
the App.config.
--
Kalyan G Reddy - INFOPATH MVP 2007
http://www.ggktech.com
:
Hi Kalyan
When I upload the XSN template to SharePoint I wonder if it has any
reference to the app.config.exe at runtime. May be it is not seeing this file
at all. Would that be possible you think?
I am not sure if you saw this
May be explaining the steps would will make things clear
From My Visual Studio Project I click on Manifest.xsf and then Design tasks,
Publish form
Create MSI
Run the msi
From SharePoint Manage Form Templates I pick the xsn and activate the template
I don't see where app.config is transferred over. Could this be the problem
you think.
Thanks
Kalpana
:
Hello Kalpana
I dont see anything wrong in the code and I dont understand where it is
going wrong. May be some one else can help you out Lets wait and see
Goodluck
--
Kalyan G Reddy - INFOPATH MVP 2007
http://www.ggktech.com
:
Hi Kalyan
Lets say this is what I have in my app.config
<appSettings>
<add key="Administrator" value="administrator"/>
<add key="Password" value="password$"/>
</appSettings>
and this what i am using in form.cs code
string administrator = string.Empty;
string password = string.Empty;
administrator = ConfigurationManager.AppSettings["Administrator"];
password = ConfigurationManager.AppSettings["Password"];
I just get empty string. This is frustrating.....
Thanks for your help
Kalpana
:
Hello
App.config can be read the same way as web.config file.
which version of VS are you using? if it is VS2005 use
configurationManagerin place of ConfigurationSettings.
Also check whether the Administrator is mentioned in the App.config correctly
Also No need of using ToString();This will throw an error when your function
returns a null value. You should write a condition to execute ToString();
when it is not Null
--
Kalyan G Reddy - INFOPATH MVP 2007
http://www.ggktech.com
:
Hi all
Is it possible to read from app.config file like you would in the web app or
win app. I tried
System.Configuration.ConfigurationSettings.AppSettings["Administrator"].ToString();
- for one it is an obselete method - but from my intellisense i don't get the
Configuration Manager , but apart from it I get Object set to null .
Any help is greatly appreciated...
Thanks
Kalpana