0
Try this instead:
string strCmdLine;
strCmdLine = @"/C SQLLDR user/pwd@O11G CONTROL=D:\ControlFile.ctl";
System.Diagnostics.Process process1;
process1 = System.Diagnostics.Process.Start("CMD.exe", strCmdLine); // this process is now associated with process1
process1.WaitForExit();
process1.Close();
There's no need to set the EnableRaisingEvents property to false as it's false, by default, anyway.
Accepted 0
Thanks Working fine..
0
@Vulpes Sir,
Yes, You are right...no need for this line.
System.Diagnostics.Process process1;
//process1 = new System.Diagnostics.Process();
string strCmdLine = @"/c SQLLDR user/pwd@O11G CONTROL=D:\ControlFile.CTL";
process1=System.Diagnostics.Process.Start("CMD.EXE", strCmdLine);
process1.WaitForExit();
process1.Close();
0
Incidentally, Datta, there's no need for this line:
process1 = new System.Diagnostics.Process();
because the static Process.Start method will create a new Process object anyway and assign it to the variable process1.
0
Thanks Vulpes Sir,
Its working now, B'coz I didn't assign start process to process1 object. This solution I didn't find any other websites. Again thanks for your useful solution.
System.Diagnostics.Process process1;
process1 = new System.Diagnostics.Process();
string strCmdLine = @"/c SQLLDR user/pwd@O11G CONTROL=D:\ControlFile.CTL";
process1=System.Diagnostics.Process.Start("CMD.EXE", strCmdLine);
process1.WaitForExit();
process1.Close();
0
Hi Vulpes Sir,
I have tried whatever you said, but still getting same error. Please give me appropriate solution. Thanks for replying.
System.Diagnostics.Process process1;
process1 = new System.Diagnostics.Process();
string strCmdLine = @"/c SQLLDR user/pwd@O11G CONTROL=D:\ControlFile.CTL";
System.Diagnostics.Process.Start("CMD.EXE", strCmdLine);
process1.WaitForExit();
process1.Close();