Click here to Skip to main content
15,907,910 members
Home / Discussions / C#
   

C#

 
QuestionSudoku problem [modified] Pin
GravityKoch26-Aug-09 9:45
GravityKoch26-Aug-09 9:45 
AnswerRe: Sudoku problem Pin
EliottA26-Aug-09 11:21
EliottA26-Aug-09 11:21 
AnswerRe: Sudoku problem Pin
Henry Minute26-Aug-09 14:49
Henry Minute26-Aug-09 14:49 
GeneralRe: Sudoku problem Pin
GravityKoch26-Aug-09 20:26
GravityKoch26-Aug-09 20:26 
QuestionLoading status bar for data in other form !! Pin
rocky81126-Aug-09 9:29
rocky81126-Aug-09 9:29 
AnswerRe: Loading status bar for data in other form !! Pin
I Believe In GOD26-Aug-09 9:58
I Believe In GOD26-Aug-09 9:58 
AnswerRe: Loading status bar for data in other form !! Pin
DaveyM6926-Aug-09 10:04
professionalDaveyM6926-Aug-09 10:04 
QuestionProblem wrting to custom config element Pin
CTaylor8926-Aug-09 9:25
CTaylor8926-Aug-09 9:25 
I have created a custom configuration section in my config file. I can read from it with out any problem. How ever, When I try to write a new value to the element I get an error: "System.Configuration.ConfigurationErrorsException: The configuration is read only".
This is a desktop application so I wouldn't think it was because of insufient permissions. Any suggestions on how to solve this would be very much appreciated.

// This is what is in the config file

<configuration>
<configsections>


<appsettings>
<add key="QueryStartDate" value="05-07-2009">
<add key="QueryEndDate" value="11-07-2010">

<connectionstrings>
<add name="DB_RS2100" connectionstring="Driver={MySQL ODBC 3.51 Driver};Server=127.0.0.1;DATABASE=DB_RS2100;OPTION=3">

<custom
stringvalue="Veh8900"
="">


// This is the class I am using to access the custom config section.
namespace CSDBControl
{
class CustConfig: ConfigurationSection
{
private static ConfigurationProperty s_propString;

static CustConfig()
{
// Predefine properties here
s_propString = new ConfigurationProperty(
"stringValue",
typeof(string),
null,
ConfigurationPropertyOptions.IsRequired
);
}

// Gets/sets the StringValue setting.
[ConfigurationProperty("stringValue", IsRequired = true)]
public string StringValue
{
get { return (string)base[s_propString]; }
// **** This is where the read only error occurs
set { base[s_propString] = value; }
// Also tried:
// set { this[s_propString] = value; }
// set { this["stringValue"] = value; }
}
}
}

// I am accessing my configuration file like this:
string SelVehicles = "Vehicle1;
CustConfig custConfig = (CustConfig)ConfigurationManager.GetSection("custom");
// This works, I can read the value just fine
string test = custConfig.StringValue;
// This does not work. Not able to write to he config file.
custConfig.StringValue = SelVehicles;

Craig

QuestionDrag and Drop Pin
JimLaVine26-Aug-09 9:07
JimLaVine26-Aug-09 9:07 
AnswerRe: Drag and Drop Pin
kKamel26-Aug-09 11:18
kKamel26-Aug-09 11:18 
GeneralRe: Drag and Drop Pin
JimLaVine26-Aug-09 11:20
JimLaVine26-Aug-09 11:20 
GeneralRe: Drag and Drop Pin
kKamel26-Aug-09 11:22
kKamel26-Aug-09 11:22 
AnswerRe: Drag and Drop Pin
Kevin Marois26-Aug-09 11:51
professionalKevin Marois26-Aug-09 11:51 
QuestionMouse Scheme in windows Pin
caiena26-Aug-09 7:11
caiena26-Aug-09 7:11 
AnswerRe: Mouse Scheme in windows Pin
I Believe In GOD26-Aug-09 9:56
I Believe In GOD26-Aug-09 9:56 
QuestionProgress bar [loading progress bar for background data load ] Pin
smoothcriminal26-Aug-09 6:29
smoothcriminal26-Aug-09 6:29 
AnswerRe: Progress bar [loading progress bar for background data load ] Pin
Henry Minute26-Aug-09 7:12
Henry Minute26-Aug-09 7:12 
AnswerRe: Progress bar [loading progress bar for background data load ] Pin
DaveyM6926-Aug-09 7:23
professionalDaveyM6926-Aug-09 7:23 
GeneralRe: Progress bar [loading progress bar for background data load ] Pin
rocky81126-Aug-09 8:12
rocky81126-Aug-09 8:12 
GeneralRe: Progress bar [loading progress bar for background data load ] Pin
Henry Minute26-Aug-09 8:29
Henry Minute26-Aug-09 8:29 
QuestionP2P connections between apps in different LAN environments Pin
Patrick Eckler26-Aug-09 6:21
Patrick Eckler26-Aug-09 6:21 
AnswerRe: P2P connections between apps in different LAN environments Pin
yuemeng7-Apr-10 20:23
yuemeng7-Apr-10 20:23 
GeneralRe: P2P connections between apps in different LAN environments Pin
Patrick Eckler2-May-10 10:14
Patrick Eckler2-May-10 10:14 
QuestionOffice View Component does not set Differrent First Page Header Pin
dptalt26-Aug-09 6:12
dptalt26-Aug-09 6:12 
QuestionSerialize a collection of objects Pin
godfetish26-Aug-09 5:58
godfetish26-Aug-09 5:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.