Hi Everyone,
I am having a txt file config.txt on application start up path.I need to read that file line by line using a delimiter ; or , and store the values in a variable to connect to the database. Currently I am hardcoding the initial database connection.
I have to read the following from txt file and store in varable so that I can pass this to the connection string.If anyone have any other way of doing this will be great.Thanks in advance.
Server:
Database:
UID:
Password:
I am having a txt file config.txt on application start up path.I need to read that file line by line using a delimiter ; or , and store the values in a variable to connect to the database. Currently I am hardcoding the initial database connection.
Code:
//code
// Mysql database initialize and connection to Profile
string strprofile = "DRIVER={MySQL ODBC 5.1 Driver};" + "SERVER=192.168.1.9;" + "DATABASE=profile;" + "UID=root;" + "PASSWORD=selva123;" + "OPTION=3";
//code
Server:
Database:
UID:
Password:
Comment