473,404 Members | 2,178 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,404 software developers and data experts.

Append to App.exe.config at run time

Hai All

I am developing a VB application in .NET.

I read a encrypted text file which contains details of SQL Server name, SQL DBName etc... for DB Connection and i prepare a connection string for global use

I also read from a book, that the connection string can be placed in "appname.exe.config" file for windows application. Is there any way to write/append key value pairs into the config file at run time

Thanks
V.Boomessh
Jul 21 '05 #1
4 1948
Hi V,

Did you place this question as well in the newsgroups

microsoft.public.dotnet.language.vb or/and
microsoft.public.dotnet.framework.adonet

(make your subject Connectionstrings and XML and App.config)

For to store an connection string are a lot of places.
An XML datasetfile
A real XML file (see the link from Scorpion)
The registry
A central SQL server
A textfile
A ini file

I prefer the first one.

I know that Scorpion made it for a real XML file.
http://www.kjmsolutions.com/flexible...tionstring.htm

I hope this helps?

Cor
Jul 21 '05 #2
Hai cor

Thanks for the reply and from the points i gathered from the site you specified, i need to clarigy a question with you again

Is it possible to load the appname.exe.config as an xmldocument and append my server settings key value pair in to it

Thanks
V.Boomessh
Jul 21 '05 #3
Hi V,

This is not my direct stuff, I know what you want to do, however it is not
the way I do it.
Ask it again in the newsgroups I pointed you on with the words I suggested.

Cor
Jul 21 '05 #4
>I read a encrypted text file which contains details of SQL Server name, SQL DBName etc...
for DB Connection and i prepare a connection string for global use.
I also read from a book, that the connection string can be placed in "appname.exe.config"
file for windows application.
Is there any way to write/append key value pairs into the config file at run time.


Not out of the box, no. By default, the myapp.exe.config files are
considered read-only, which makes good sense if you think about it -
they'll be located in the same directory as the app, which normally
isn't one that the average user (at least in a corporate environment)
has write access to anyway.

Since the .config files are nothing but straight XML files, you can
easily write your own class to load the existing XML config file, add
or modify entries, and write the XML file back. MIND YOU: check for
permission to do so!! You might not be able to write it back (since
your user running your app might not have write permission where the
file is located).

Marc

================================================== ==============
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
Jul 21 '05 #5

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

Similar topics

19
by: John Keeling | last post by:
Dear all, I tried the test program below. My interest is to examine timing differences between insert vs. append & reverse for a list. My results on my XP Python 2.3.4 are as follows:...
16
by: DraguVaso | last post by:
Hi, I have a Windows Service running (made in VB.NET), and wanted to be able to change from time to time some parameters by changing them in the App.config. But it seems that the application...
9
by: JMCN | last post by:
hi- i have inherited an access 97 database that keeps track of the loans. i have been running into referential intergrity problems when i try to append new loans to table. first of all is a...
4
by: V.Boomessh | last post by:
Hai All I am developing a VB application in .NET. I read a encrypted text file which contains details of SQL Server name, SQL DBName etc... for DB Connection and i prepare a connection string...
5
by: Michael C via AccessMonster.com | last post by:
Hello, I have a table that I am appending 3 seperate tables into. My main problem is that each time I append the data, it simply adds to the data already there. That might sound ok, except that...
17
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
0
by: audleman | last post by:
I have an ASP form on my website where a visitor enters information. On submit, the form calls a stored procedure stores in a MS SQL 2000 database. The stored procedure works most of the time, but...
4
by: pmacdiddie | last post by:
I have an append query that needs to run every time a line item is added to a subform. The append writes to a table that is the source for a pull down box. Problem is that it takes 5 seconds to...
2
by: sj | last post by:
Situation: I have 2 tables, parent table (Invoice) and child table (InvoiceDetails) that is link by InvID in the child. Requirement: Need to do one-time append of information to another table...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.