txtPwd =User Password
txtHS =Host String
filename =e.g. c:\BackupFile.dmp
Collapse | Copy Code
<pre lang="vb">
Shell("exp " & txtUser.Text.ToString.Trim & "/" & txtPwd.Text.ToString & "@" & txtHS.Text.ToString & " buffer=4096 grants=Y file=" & filename, vbNormalFocus)
Write above code on a button to execute. It takes backup of all data of one user from oracle database.
OR
StreamWriter sw = new StreamWriter("reports\\backup.bat");
string name = "backUP-"+".dmp";string code1 = "exp "+orclUser+"/"+orclPass+"@"+orclService+" file = Backup\\"+name+" ";sw.WriteLine(code1);
sw.Close();
string strFilePath = System.IO.Path.GetFullPath("C:\\backup.bat");ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();psi.FileName = strFilePath ;
psi.Arguments = "1 2 3 4";
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo = psi;
p.EnableRaisingEvents = true;p.Start();