T

T

  • NA
  • 5
  • 0

How to access a properties file???

Jul 13 2006 1:45 AM
Hi,

I am developing a web application in ASP .net using C#. I have a form that displays the contact information fetched from the database. But my requirement is - the connection string should be fetched from a file (like the properties file that we have in Java) which stores all the connection strings for different database server types. This connection string is fetched by a connection class that will use the information from the file to create a connection object usign which the database is accessed. I know how to access this file in java but since I'm new to .net, I'm stuck here. Can anyone please help me accesss this properties file??
Also, is the funtion performed by .ini file same as a properties file? So, if I use an ini file, how to I access it to retrieve the connection string ?
In java, we have Resource Bundle that can be accessed as
        ResourceBundle bundle = ResourceBundle.getBundle(<properties filename>);
then using this object you can access the key-value pair in the file. 
Is there anything similar to this in ASP .net?? How do i access it ???

Please help!!!!!

Answers (1)