|
I need to load/save some settings from another assembly so I changed the code to:
Configuration configManager = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
ConfigurationSectionGroup section = configManager.SectionGroups["userSettings"];
if (section != null)
{
ClientSettingsSection clientSettings = section.Sections["OutlookSync.Properties.Settings"] as ClientSettingsSection;
SettingElement element = clientSettings.Settings.Get("SalutSetting");
clientSettings.Settings.Remove(element);
element.Value.ValueXml.InnerText = "update";
clientSettings.Settings.Add(element);
configManager.Save();
}
Everything is nice and smooth when i run this code on a test project - applications are modified and next time i start the application, the updated config is taken, but when i include it in my application, the changes are not saved next time when the application starts. I searched everywhere in the application in order to find our if the configurations are override but it seems they are not. I'm complete shocked and without any ideas.
|
|
|
|
|
Sorry, I can only suggest some methods to find out some more:
Have you checked the file before and after the call to configManager.Save(); Just to see if they're being written and then overwritten. Or try making the settings file read-only and see if you get an exception when trying to save. If it does then at least you can confirm it's trying to write stuff to the file.
|
|
|
|
|
hi
I use crystall report for reporting but its too slow.How can i made it fast?
|
|
|
|
|
Hi all,
Please let me know about any class avail in .NET 2.0 to transmit single file with Credentials(username and password) on to server.
I have tried with HttpWebRequest class, but getting some problem. Do .NET have any classes to transmit file on Server.
Thanks,
Regards
Chintan
HCL Technologies...India
(Carefully) listen->(Deeply)Think->(Clearly)Understand->(Patiently) reply...
|
|
|
|
|
How about trying FtpWebRequest? Found in the System.Net namepace.
He who makes a beast out of himself gets rid of the pain of being a man
|
|
|
|
|
Is it possible to control the layout of controls on a form at runtime.
Actually I have a xml file which will contain some questions & the type of answer it expects. I need to design an interface with these questions on different labels & appropriate controls for accepting the answer to these questions (it might check box, radio button or textbox...)
Thanks in Advance,
Cheers
|
|
|
|
|
jamesjk wrote: Is it possible to control the layout of controls on a form at runtime.
Yes, just write code that adjust the particular properties of the controls that you want to change. e.g. If you want to change the text of a label. just do myLabel.Text = "NewText"; If you want to add new controls, you can create them just as you would with any other object, and then you just need to add them to the forms .Controls collection.
Label myNewLabel = new Label();
myNewLabel.Text = "NewText";
this.Controls.Add(myNewLabel);
myNewLabel.Left = 50;
myNewLabel.Top = 50;
myNewLabel.Visible = true;
myNewLabel.BackColor = Color.Red;
Simon
|
|
|
|
|
Thanks Simon.
The main problem I'm facing is that the xml will be variable. I'm providing a xml editor to the user so that he can add as many questions in it.
With uncertain number of questions do you have any suggestions on how i'll be able to manage the layout ?
Thanks Again for the reply.
|
|
|
|
|
You could have 1 page per question, just do your layout for a page to fit 1 question on it, then have controls to move to the next question, which would have exactly the same layout just with the question text and answers changed. (it wouldn't actually need to be a differnt page or form or anything, just change the text on the form to match the next question)
Or, you could use something like the FlowLayoutPanel, which would allow you to add controls to it and it rearranges them to flow in order. You'd probably create one Panel per question, using a predefined layout for the panel, with question and answer buttons, then added each of the question panels to 1 main FlowLayoutPanel which would take care of ordering the question panels for you.
Simon
|
|
|
|
|
HI,
I'm working on a .Net windows application with C#. How to keep labellink control in DataGridView. One of the DataGridView's column contains the labellink controls. Please guide me. Thanks in advance.
modified on Thursday, April 17, 2008 5:55 AM
|
|
|
|
|
You can create your own column class by inheriting the DataGridViewColumn class or any of its derived classes to provide custom appearance, behavior, or hosted controls.
|
|
|
|
|
Hello,
I am having 4 list boxes and i want at a time only single list box's item should be selecteble. If user has seleted item of one ListBox and then click on the item of another ListBox then previous one should be deselected.
Is there any way provided so we can directly control the selection across the ListBoxes?
As of now, i handled selection exent of each ListBox and write appropriate code but i am looking for some better way to do it.
Thanks.
|
|
|
|
|
gajesh wrote: As of now, i handled selection exent of each ListBox and write appropriate code but i am looking for some better way to do it.
Nothing wrong with doing it like that. What don't you like about it?
Simon
|
|
|
|
|
Thaks Simon,
I wanted something like radio button group. Just group them and the selection will be taken care automatically.
Thanks.
|
|
|
|
|
There's nothing simple like that already.
You could write your own custom control (probably inherit from Panel) that you put the listboxes into and your custom control could automatically do the clearing of all the selections, but I'd say that's unnecessary unless this is a pattern you find yourself repeating over and over again.
Simon
|
|
|
|
|
I'm trying to create a desktop application that has a database support. This database has to be locked and can only be opened by my specific application.
Do I need to use the dlls from SQL Server Compact Edition ? Or just create a Database file in Vis Stud 2005 itself ?
Can someone point me in the direction of how to do it?
|
|
|
|
|
You can create database in sql2005 with username and password. So you can be sure that your specific app just can use with this database.
|
|
|
|
|
If I just use SQL Server on client's machine, they're the one who will set up username & password. I would like everything to be automated (1 installer if possible) which has its own database
|
|
|
|
|
hi all,
I am always get the error below:
An unhandled exception of type 'System.StackOverflowException' occurred in TimewayGeneratorRev2.exe
This occur when i declare a form,like below:
namespace TimewayGeneratorRev2
{
public partial class FrmProSetting : Form
{
FrmMain fMain = new FrmMain(); <---------an exception above high light here
public FrmProSetting()
{
InitializeComponent();
}
}
}
Can someone help me on this
Note: In my application, i have few forms.
regards
cocoon
modified on Thursday, April 17, 2008 4:58 AM
|
|
|
|
|
StackOverflowException occurs when you call methods too deeply, and the stack of method calls gets too big to hold in the memory reserved for the stack. StackOverflows often occur when you get stuck in a recursive loop. When it occurs, look at the callstack (Debug->Windows->Callstack) and look back along it. You'll probably find it's going round and round in a circle calling the same methods over and over again. You need to break this loop. Remove one of the calls so the loop doesn't occur.
Look in the FrmMain constructor, are you creating a FrmProSetting form from there?
Simon
|
|
|
|
|
hi Simon,
Thanks for your fast reply. Yes, i have create a FrmProSetting form in frmMain.
|
|
|
|
|
|
hi
how Can i invoke visual studio built-in Query Builder
at runtime ?
|
|
|
|
|
|
can i call the query builder ( that is available at design time ) at run time
|
|
|
|