I have been on working windows console application to import xml data into database.
I am new to console applications,
I have a task i.e i want to import xml data from folders(which are created and saved xml files ex:c:\Projects\XMLfolder\folder\abc.xml, c:\Projects\XMLfolder\folder1\xyz.xml,)
for this i don't want to hard code, the file path for this just add key/value in the app.config file. Based on file path how to read xml files one by one(if exist file folder) if not exist xml file in current folder go next folder read the file if exist, after completion of reading file in a folder file need to move into another folder based on path mentioned in app.config.
How would i achieve this?
Suthish NairPosted Sep 13, 2013, 7:39 AM
Joxin StanlyPosted Sep 12, 2013, 10:46 AM
you can read these settings from app.config file as below -:
string folderName = ConfigurationManager.AppSettings["Folder"];
hope this helps..
Indra RPosted Sep 12, 2013, 9:11 AM
Indra RPosted Sep 12, 2013, 9:11 AM
Joxin StanlyPosted Sep 12, 2013, 7:51 AM
not sure if my idea matches your req -:
a key value pair to holder base folder name -: c:\Projects\XMLfolder\
another key value pair to hold folder names(comma seperated) say eg -: folder,folder1,folder2
i hope this give you an idea ...