473,378 Members | 1,387 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,378 software developers and data experts.

Creating a custom .Config file

I Created a .config file for my Web application and named it
"Settings.config"

The file contains some settings for the application, including a connection
string to a database.

But i don't see how a System.Configuration. class finds the file.

I expected to be doing something like this:

'I just use 'AppSettingsReader' as an example here

Dim k as New system.Configuration.AppSettingsReader
k.Filename = mypath & "Settings.config"

Dim s As String = CType( k.GetValue("Connectionstring"), String)

But i don't find a .Filename property, and that tells me that you can only
use these Classes with the 'standard' .config files. The files that .Net
expect to be there; Like machine.config and maybe web.config.

How do i get to read values from my Custom .config file?
Nov 18 '05 #1
2 1493
Why not just use web.config?

"Jarod_24" <ja******@hotmail.com> wrote in message
news:74******************************@news.teranew s.com...
I Created a .config file for my Web application and named it
"Settings.config"

The file contains some settings for the application, including a connection string to a database.

But i don't see how a System.Configuration. class finds the file.

I expected to be doing something like this:

'I just use 'AppSettingsReader' as an example here

Dim k as New system.Configuration.AppSettingsReader
k.Filename = mypath & "Settings.config"

Dim s As String = CType( k.GetValue("Connectionstring"), String)

But i don't find a .Filename property, and that tells me that you can only
use these Classes with the 'standard' .config files. The files that .Net
expect to be there; Like machine.config and maybe web.config.

How do i get to read values from my Custom .config file?

Nov 18 '05 #2
"Paul Wistrand" <pw*******@hotmail.com> wrote in message
news:el**************@TK2MSFTNGP09.phx.gbl...
Why not just use web.config?

Maybe i'm just weird, but i'd prefer to have my own custom .config file, and
not start mixing up these things with all the generic .net settings that are
in there.
"Jarod_24" <ja******@hotmail.com> wrote in message
news:74******************************@news.teranew s.com...
I Created a .config file for my Web application and named it
"Settings.config"

The file contains some settings for the application, including a

connection
string to a database.

But i don't see how a System.Configuration. class finds the file.

I expected to be doing something like this:

'I just use 'AppSettingsReader' as an example here

Dim k as New system.Configuration.AppSettingsReader
k.Filename = mypath & "Settings.config"

Dim s As String = CType( k.GetValue("Connectionstring"), String)

But i don't find a .Filename property, and that tells me that you can only use these Classes with the 'standard' .config files. The files that .Net
expect to be there; Like machine.config and maybe web.config.

How do i get to read values from my Custom .config file?


Nov 18 '05 #3

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

Similar topics

7
by: Ken Allen | last post by:
I have a .net client/server application using remoting, and I cannot get the custom exception class to pass from the server to the client. The custom exception is derived from ApplicationException...
3
by: Damian | last post by:
Hi everyone I'm having an issue with one of our applications. I'm getting the following error when attempting to log in to the site: Server Error in 'xxxxxxxxxxxxxxxx' Application....
7
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*"...
5
by: Graham | last post by:
I have created a custom MembershipProvider called "LassieMembershipProvider" that derives from "MembershipProvider". This providor is located in a Businesslogic layer dll called...
9
by: Rotzooi | last post by:
Hi, I have a VB.NET Service application that's running fine under the Local System account. But for configuration purposes I don't want to be dependent on modifying the registry manually or...
0
by: thehitman | last post by:
I used an article "Creating a Flexible Configuration Section Handler "(http://www.15seconds.com/issue/040504.htm). The Console application works with app.config but with the web.config. The...
3
by: Laser Lu | last post by:
Hello, everybody, In order to avoid making web.config lengthy, I just moved some custom configuration settings out from web.config, and centralized them into an xml file, which names data.config....
3
by: Jason Richmeier | last post by:
Is it possible to create a custom configuration file (other than app.config) that can be processed by classes in the System.Configuration namespace? I have seen a ton of articles that talk about...
0
by: Atul Thombre | last post by:
Hello, I am developing a custom membership provider. For that I built a prototype that uses a SQL Server 2005 database as a backend store. I implemented the class...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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.