473,382 Members | 1,086 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Write Namevalue pair into Config file

Hi, I have this constraint. A help would be greatly appreciated.
I have this Config file.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="Mainsection">
<section name="ConnectionString"
type="System.NamevaluesectionHandler,System" />
</sectionGroup>
</configSections>

<Mainsection>
<ConnectionString>
<add key="projcode1" value="database"/>
<add key="projcode2" value="database2"/>
</ConnectionString>
</Mainsection>

I use VB.NET to read this section.
I want to use DPAPI with Machine store. For this I have to read the
connection string from config file as name value pair, Then encrypt the
connection string & want to replace back the encrypted string into the
same section of config file.
I have an issue in writing Namevalue pair into the same section. Could
somebody please help me with writing as name value pair, as an attribute
into the section.
I used configuration management application block from microsoft to
write. But then I was unable to write namevaluepair as an attribute to a
element in a node.

A help would be greatly apprecitaed.
Thanking you
Shaun

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
0 872

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Shaun Ram | last post by:
Hi I have this constraint. A help would be greatly apprecitated. I have this Config file. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <sectionGroup name="ITASCA">...
6
by: ALI-R | last post by:
I have tree variable with their values: 1) rptName="report1" 2) rptPath="c:\......" 3) serverPath=http://server... and 4)an arry which contain Name/value pairs. what is the best way of...
9
by: ALI-R | last post by:
Hi,, I have two questions : 1) Is it mandatory that config file of a desktop application must be App.config 2) Is it possible to update config file in your code?? thanks for your help. ALI
1
by: Charles | last post by:
I'm reading some stuff in a custom section of the web.config file into a name value collection. What do I need to do to make this work: Dim nvcConfig As NameValueCollection = _...
0
by: Shaun Ram | last post by:
Hi, I have this constraint. A help would be greatly appreciated. I have this Config file. <?xml version="1.0" encoding="utf-8" ?> <configuration> <configsections> <sectionGroup...
4
by: feng | last post by:
..Net's .config file is supposed to replace the .ini files. That's all fine if all I need is to read from it. But what if I need both read and write? With .ini file, I can do that very easily with...
3
by: Agnes | last post by:
Can I write a file like config.ini which store the server-name, userid & password, So, my application can read the config.ini file and get the server - name, Does my concept is correct ? If...
10
by: lkrich7 | last post by:
hello, I wrote the following definition: typedef vector< pair<char, TrieNode* TrieNode; but it can't be compiled, because "TrieNode" is not declared in fact my aim is: struct Pair; typedef...
0
by: valdas | last post by:
Hi, I have a problem in accessing "sqlServerCatalogNameOverwrites" section in app.config file. <configuration> <configSections> <section name="sqlServerCatalogNameOverwrites" ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.