Hello Everyone
I want to take a backup of the oracle database using c#
am using the code below but give this error: System.InvalidOperationException: 'The Process object must have the UseShellExecute property set to false in order to redirect IO streams.

any help please?????????

System.Diagnostics.Process p = new System.Diagnostics.Process();

            string strexp = "exp userid='system/M19871991b@orcl as sysdba' full=yes file='c:\qw.dmp'";
            p.StartInfo.FileName = "cmd.exe";
            p.StartInfo.UseShellExecute = true;
            p.StartInfo.RedirectStandardInput = true;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.EnableRaisingEvents = true;
            p.StartInfo.CreateNoWindow = true;
            try
            {
                p.Start();
                p.StandardInput.WriteLine(strexp);
                p.StandardInput.WriteLine("exit");
                p.WaitForExit();
                MessageBox.Show("s");
            }
            catch (Exception ex)
            {
                throw ex;
                }
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.