15,921,028 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by tek001 (Top 20 by date)
tek001
24-Jun-15 5:03am
View
First of all thanks for answering. I've no choice; the embedded resources are third party ones! My boss asked me to create an application to read and alter values of the keys contained in the other application’s resources .dll files.
tek001
23-Jun-15 6:04am
View
Deleted
Up!
tek001
24-Apr-15 9:34am
View
Hello,
My company asked me to create a WinForm Enterprise Library like graphical interface so that the end users can easily configure their own application’s app.config without working directly with the xml files.
Opening my application and pointing and .exe file, will dynamically creates labels for keys and textboxes for values and so they can browse for logfiles paths, enter the required connection strings information and so on.
Best regards,
Tek001
tek001
24-Apr-15 8:29am
View
Thanks a lot, it works!
tek001
24-Apr-15 7:28am
View
Hi,
I tried treating the app.config file as an XMLFIle so I did this to get the chlidNode of the node <listeners>
:
public void getListeners(string appName)
{
try
{
string FILE_NAME = string.Concat(appName, ".config");
XmlTextReader reader = new XmlTextReader(FILE_NAME);
XmlDocument doc = new XmlDocument();
doc.Load(reader);
reader.Close();
string nodeRoute = "loggingConfiguration";
XmlNodeList elemList = doc.GetElementsByTagName(nodeRoute);
{
foreach (XmlNode elem in elemList)
{
foreach (XmlNode elemChild in elem.ChildNodes)
{
if (elemChild.Name.ToString() == "listeners")
{
int cpt = 0;
foreach (XmlNode item in elemChild.ChildNodes)
{
MessageBox.Show(item.OuterXml.ToString());
cpt++;
}
}
}
}
}
}
catch (Exception ex)
{
errorHandler(ex);
}
}
Now how can I get the different attributes separately?
And since the OuterXml property is read only, how can I do to set values?
Thanks for your help.
Best regards,
Tek001
tek001
23-Apr-15 12:15pm
View
I did this to get the chlidNode of the node <listeners>
<add name="... traceOutputOptions=" none"="" ...=""> :
public void getListeners(string appName)
{
try
{
string FILE_NAME = string.Concat(appName, ".config");
XmlTextReader reader = new XmlTextReader(FILE_NAME);
XmlDocument doc = new XmlDocument();
doc.Load(reader);
reader.Close();
string nodeRoute = string.Concat("loggingConfiguration");
XmlNodeList elemList = doc.GetElementsByTagName(nodeRoute);
{
foreach (XmlNode elem in elemList)
{
foreach (XmlNode elemChild in elem.ChildNodes)
{
if (elemChild.Name.ToString() == "listeners")
{
int cpt = 0;
foreach (XmlNode item in elemChild.ChildNodes)
{
MessageBox.Show(item.OuterXml.ToString());
cpt++;
}
}
}
}
}
}
catch (Exception ex)
{
errorHandler(ex);
}
}
Now how can I get the different attributes separately?
And since the OuterXml property is read only, how can I do to set values?
Thanks for your help.
Best regards,
Tek001
tek001
22-Apr-15 17:45pm
View
Now I've tried this:
void showListeners()
{
Configuration MyConfig = ConfigurationManager.OpenExeConfiguration(ConfigurationManager.AppSettings["configFileExe"]);
var section = (AppSettingsSection)MyConfig.GetSection("loggingConfiguration");
string results = section.Settings["name"].Value;
MessageBox.Show(results);
}
but I get the ConfigurationErrorsException below at the second line - var section = (AppSettingsSection)MyConfig.GetSection("loggingConfiguration"); :
An error occurred creating the configuration section handler for loggingConfiguration: Could not load file or assembly 'Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
I don't understand, I just want to read information...
Best regards,
Tek001
tek001
22-Apr-15 17:13pm
View
Hi,
Thanks for this reply but how can I access to a third party configSections since the targeted app.config doesn't belong to my application?
I've tried this but there's no result: which is a regular behavior cause I'm looking in my own app.config!
class LoggingConfiguration : ConfigurationSection
{
private static readonly ConfigurationProperty Name;
private static readonly ConfigurationPropertyCollection ConfigurationProperties;
static LoggingConfiguration()
{
// configuration properties here
Name = new ConfigurationProperty("name", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
ConfigurationProperties = new ConfigurationPropertyCollection { Name };
}
[ConfigurationProperty("name", IsRequired = true)]
public string name
{
get { return (string)base[Name]; }
}
protected override ConfigurationPropertyCollection Properties
{
get { return ConfigurationProperties; }
}
}
and then in my main program:
void showListenersName()
{
var loggingConfiguration = ConfigurationManager.GetSection("loggingConfiguration") as LoggingConfiguration;
if (loggingConfiguration != null)
{
MessageBox.Show(loggingConfiguration.name);
}
}
PS: I can read a third party app.config from my application by using this:
public static Configuration configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationManager.AppSettings["configFileExe"]);
with this in my application app.config:
<add key="configFileExe" value="C:\Users\Tek001\Desktop\TestConfig\Test.exe">
Best regards
tek001
14-Apr-15 17:49pm
View
done for appSettings section:
List<string> values = new List<string>();
for (int cpt=0; cpt < TabKeys.Length; cpt++)
{
string value = configFile.AppSettings.Settings[TabKeys[cpt]].Value.ToString();
values.Add(value);
}
string[] Values = values.ToArray();
tek001
14-Apr-15 17:43pm
View
Actually I did this for keys :
Configuration configFile = ConfigurationManager.OpenExeConfiguration(@"C:\Users\teka001\BiLauncher\BiLauncher\bin\BiLauncher.exe");
string[] TabKeys = configFile.AppSettings.Settings.AllKeys.ToArray();
Now I have to find a way to retrieve associated values from this third party "BiLauncher.exe.config"
tek001
14-Apr-15 15:38pm
View
There’s nothing done yet. I'm looking for the fastest and the securest way to read an app.config file belonging to another application by a C# win32 application (WinForm or WPF) and put the collected information into labels and textboxes in a dynamic way (It doesn’t matter how many keys there’re in the file) so I can change the values of these keys and save them back to the original app.config file.
tek001
5-Sep-14 6:45am
View
done
tek001
5-Sep-14 6:43am
View
ok.
tek001
5-Sep-14 5:16am
View
The 2 fields used to join the 2 tables exist in both of them. I’ve got the same error with your query. Sorry to insist but this is definitively not an SQL issue.
PS : Oracle does not accept "as" as table's alias. 575 records returned on Toad for Oracle
tek001
5-Sep-14 5:05am
View
Yes, I'm sure.I'm working with oracle 11.2. Both querries give same result on Toad for Oracle (571 records) and i've got almost the same InvalidOperationException in C#:
"The Dynamic SQL code's generation Failed . No key information was found."
Best regards.
Tek001
tek001
5-Sep-14 4:27am
View
the 2 tables are already joined :
and i.num_int_int = u.num_int_int
and i.cod_soc = u.cod_soc
=> this is not an SQL issue.
tek001
5-Sep-14 4:18am
View
I'm an SQL Developer and the query works fine on SQL+ or Toad
tek001
5-Sep-14 4:15am
View
Ok, I'm sorry.
tek001
5-Sep-14 4:14am
View
done
tek001
5-Sep-14 4:14am
View
No actualy the SQL query works only if it contains a single table (second example) whatever the arithmetical sign is (<>, =). Using more than one table (2 in the first example) rises the InvalidOperationException!
Show More