473,765 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add my own object into app.config and read it?

1 New Member
Hi

I'm trying to add a new section to my app.config file under the applicationSett ings section and then read it from my WinFroms VB.NET application.

My app.config would look like this:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <configuration>
  3.     <system.diagnostics>
  4.     </system.diagnostics>
  5.   <applicationSettings>
  6.     <Users_Settings>
  7.        <User Name="user_1"
  8.              server_dev="server_1" password_dev="123"
  9.              server_test="server_2" password_dev="123" />
  10.        <User Name="user_2"
  11.              server_dev="server_1" password_dev="123"
  12.              server_test="server_2" password_dev="123" />
  13.     </Users_Settings>
  14.   </applicationSettings>
  15.  
How do I read the list of users?
I already prepared a class that hosts both the users name and another class that holds the various servers each user has.

What I'm missing is how to read the data from the app.config when it is located under the applicationSett ings section.

Any help would be highly appreciated

BTW, I tried to Goggle this but to no avail.

Thanks
Apr 9 '11 #1
0 1508

Sign in to post your reply or Sign up for a free account.

Similar topics

2
11367
by: tamimi | last post by:
I have a guestbook form that inserts the fields into an Access Database. The database is residing in the "fpdb" folder that was created by FrontPage. The ASP page that writes the data into the databse uses the "recordset.addnew" method. The code was working fine a couple of weeks ago, and now all of a sudden the error message "Cannot update.Database or object is read-only" pops up. The ASP code or the database was not changed or...
1
3964
by: Fie Fie Niles | last post by:
I have IIS installed on XP Professional workstation machine. I have an ASP page that open connection to an Access database, then when trying to update the database, it gave me the error "cannot update database or object is read-only". This is a workstation machine, not connected to any other computer, and I login to the PC using an administrator account. I already check the .MDB file is NOT read-only. But, I do not see the .LDB file....
0
534
by: mr_wizard | last post by:
I posted a message yesterday on my difficulty in updating an Access table. Yesterday the error response was permission related. I've gotten past that, but still cannot update the table. XP Pro IIS 5 Access 2002 ASP page ODBC File DSN = "Twmp DBs" The error message on an SQL update is :Cannot update. Database or object is
0
6017
by: PaulB | last post by:
Hi there, Allthough I searched for previous posts, I was unable to solve my problem. I try to link my front-mdb with an Excel file using the next line DoCmd.TransferSpreadsheet acLink, 8, "TblParameters", "C:\Parameters.xls", True, "" This works perfect for Access 2000, while for Access 2002 and Access 2003 I get error message 3027: cannot update: database or object is read
3
3053
by: Mark | last post by:
Hello all - This has been frustrating me long enough that I'm willing to appeal to the gurus out there to put this in my rear view mirror. I'm trying to access a JPEG file that I have within my website but need to show within a Crystal Report. I setup a disconnected dataset that has 1 column and I can read the image into the dataset fine if I use a path like below: \\webserv\wwwroot\prodsite\images\1.jpg. The moment I try to use the...
5
1674
by: Stephen Costanzo | last post by:
Looking back in the group, I figured out how to read from the appSettings section of the configuration file. I have default values for the application in the unlikely event that the user deletes the configuration file. My question is this: How do I write the defaults back out to the configuration file at run time? is this even possible? I understand that the System.Configuration API is read only so would I basically have to read in...
0
2065
by: mvdkwong | last post by:
I am trying to run a macro that will export a table into a fixed length file (see below). However, when I run it, I get the following error: "Cannot update. Database or object is read-only." I've tried a few things that I found in postings, but I'm not getting anywhere. Please advise on what I can do. '------------------------------------------------------------ ' mcr_Export_Test '
0
2275
by: tom | last post by:
When I try to read in a csv file it gives me this error message. 'Cannot update. Database or object is read-only.' If I change the extension to txt it processes just fine. I have googled all sites on this and I haven't found anything to help. (tried registry stuff, reinstall .NET 2.0, patches). This just broke out the blue too which is weird because it was running fine on our server on monday but now it pukes. Here is the code. ...
1
3251
by: sweetjos | last post by:
Thank you sir, I have another question.... Recently I got this error. Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) Cannot update. Database or object is read-only. /Jose/add.asp, line 21 Browser Type:
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10156
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.