Hi,
Could anyone help me with some info how to create app.config file.
I need to put code of directory info in there, Thank you very much!
DirectoryInfo di = new DirectoryInfo(" C:\\Vicky Development\\Fu ndExplorer\\
Index\\Copy of IntlIndex");
---------------------------------------------------------------------
I know in app.config may like below
---------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<configuratio n>
<appSettings>
<!-- User application and configured property settings go here.-->
<!-- Example: <add key="settingNam e" value="settingV alue"/> -->
<add key="reportingS ervice.ServerNa me" value="Http://Localhost" />
<!-- No ending "/" -->
<add key="connOperat ions.Connection String" value="Integrat ed
Security=SSPI;P ersist Security Info=False;Data Source=HIRST-IT1\
TEST;Initial Catalog=FundMan ager42205;" />
</appSettings>
</configuration>
------------------------------------------------------------------------
And in the code when I create Reader I do below
System.Configur ation.AppSettin gsReader appReader =
new System.Configur ation.AppSettin gsReader()
;
string connString = (string)appRead er.GetValue(
"connOperations .ConnectionStri ng",typeof
(string));
SqlConnection conn = new SqlConnection(c onnString);
------------------------------------------------------------------------
Here is begining part of the code
------------------------------------------------------------------
namespace dataReader
{
class Class1
{
[STAThread]
public static void Main(string[] args)
{
DirectoryInfo di = new DirectoryInfo(" C:\\Vicky Development\\Fu ndExplorer\\
Index\\Copy of IntlIndex");
// Get a reference to each file in that directory.
FileInfo[] fiArr = di.GetFiles();
int FundID=0;
int PeriodicityID = 0;;
string Ticker=null;
string currentLine = null;
//set up sql connection string
string myConnString= "workstatio n id=HIRST-IT1;packet size=4096;"+
"Integrated Security=SSPI;i nitial catalog=FundMan ager42205;"+ "Data
Source=HIRST-IT1\\TEST;"+
"persist security info=True";
// for each file in Directory, if TickerName match DB, load data
foreach (FileInfo fri in fiArr)
{
StreamReader sr = new StreamReader("C :\\Vicky Development\\Fu ndExplorer\\
Index\\Copy of IntlIndex\\"+fr i.Name);
//read the text file
//read the first row --header
currentLine = sr.ReadLine();
//read the second row contains data
currentLine = sr.ReadLine();
-
-
-
-
-
}
--
Message posted via http://www.dotnetmonster.com