Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MmUserOptionsForm
Message
 
To
07/11/2008 14:01:51
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01359539
Message ID:
01360596
Views:
14
Tim,

Yes, that worked. It's funny since I have subclassed mmAppConfiguration and have a custom config in my application that I have been able to update. I incorrectly assumed that the WriteKeysToConfig() method knew about the default application configuration file and I did not need to pass the file name. I know, never assume. Once I passed the file name, it saved properly.

One other question, are there any methods for adding or removing keys? If I build a UI to allow a user to create a new database connection, how do I insert the new keys values. I know I can use the XmlTextWriter class, but I was looking for something in the framework.

Thanks again for your help with these questions, your assitance is very much appreciated.

Kind Regards,

Mat

>
>It took me a long time to figure some of this out. The mmAppConfiguration class is designed to work with app.config and web.config files. You will need to use the mmAppSettingsManager class to work with the custom .config file.
>
>Also, there is an overload on the WriteKeysToConfig() method that accepts the string file name. I do all my saves via a custom mmAppSettingsManager Class like this. If you have trouble getting this to work, I can send you a empty mm project with just the parts to make this work all set up for you to examine.
>
>
>public class AppSettingsManager : mmAppSettingsManager
>{
>    private static string configFile = "TipTraxConfig";
>    public void SetWSUserAndPassword(string wsUserId, string wsPassword)
>    {
>        AppDesktop.ApplicationSettings.WSUserId = wsUserId;
>        AppDesktop.ApplicationSettings.WSPassword = wsPassword;
>        AppDesktop.ApplicationSettings.WriteKeysToConfig(configFile);
>    }
>
>    public void SetTruckCode(string truckCode)
>    {
>        Appdesktop.ApplicationSettings.MyTruckCode = truckCode;
>        AppDesktop.ApplicationSettings.WriteKeysToConfig(configFile);
>    }
>}
>
>
>Tim
Matthew Kennedy
Decision Support Technology Inc.

"I try to take one day at a time, but sometimes several days attack me all at once." ~ Ashleigh Brilliant

New Jersey Dot Net User Group
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform