log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); string b =System.Configuration.ConfigurationSettings.AppSettings["OracleConnString"]; string strSQLLdrPath = System.Configuration.ConfigurationSettings.AppSettings["SQLLDRPath"]; string strSQLLdrUserId = System.Configuration.ConfigurationSettings.AppSettings["SQLLDRUserId"]; string strCntrlFilePath = System.Configuration.ConfigurationSettings.AppSettings["CntrlFilePath"]; string strDataFilePath = System.Configuration.ConfigurationSettings.AppSettings["DataFilePath"]; string strLogFilePath = System.Configuration.ConfigurationSettings.AppSettings["LogFilePath"]; string strBadFilePath = System.Configuration.ConfigurationSettings.AppSettings["BadFilePath"]; try { log.Info("Invoking SQL*Loader to load file: " + strDataFilePath); Process p= new Process(); // Start User Name Changes dt-10th Sep 2007 // if(strUserId.IndexOf(" ") >= 0) // { // strUserId = strUserId.Replace(" ",""); // } // End User Name Changes dt-10th Sep 2007 strLogFilePath = strLogFilePath + "data_"+".log"; strBadFilePath = strBadFilePath + "data_"+ ".bad"; p.StartInfo.Arguments=@strSQLLdrUserId + " control= "+ strCntrlFilePath+ " data= "+ strDataFilePath + " log= " + strLogFilePath +" bad= "+ strBadFilePath + " rows=5000 errors=15000 skip=1 "; p.StartInfo.FileName = strSQLLdrPath ; p.StartInfo.WindowStyle =ProcessWindowStyle.Hidden; p.Start(); p.WaitForExit(); log.Info("SQL*Loader work completed."); } catch(Exception ex) { log.Error("Problems with SQLLoader" ,ex); } }
using System.IO;
if(!Directory.Exists(path)) { //throw exception here or show message box like this: MessageBox.Show(path); } else { //do something here. }
if(File.Exists(filepath) { //throw exception here or show message box like this: MessageBox.Show(filepath) } else { //do something here. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)