P
Prashant
Hi,
this is my code, below, I am executing a batch file that in turn executes
multiple .sql files, my concern is if there is some problem with .sql files,
the calling program should get the error back, that is not happening.
do you have any idea how to trap the error with Process?
thanks,
Prashant
arrDbProperties = ConnectionString.Split(';');
arrServerName = arrDbProperties[0].Split('=');
arrDbName = arrDbProperties[1].Split('=');
dbName = arrDbName[1].Trim().ToString();
serverName = arrServerName[1].Trim().ToString();
sqlFilePath = webConfigPath + "ICE2.1Temp\\ICE2.1\\SQL\\";
batchFile = webConfigPath + "ICE2.1Temp\\ICE2.1\\SQL\\Drop_DB2.1.bat";
Process proc = new Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = batchFile;
proc.StartInfo.Arguments = dbName + " " + serverName + " " + sqlFilePath;
proc.Start();
proc.WaitForExit();
proc = null;
this is my code, below, I am executing a batch file that in turn executes
multiple .sql files, my concern is if there is some problem with .sql files,
the calling program should get the error back, that is not happening.
do you have any idea how to trap the error with Process?
thanks,
Prashant
arrDbProperties = ConnectionString.Split(';');
arrServerName = arrDbProperties[0].Split('=');
arrDbName = arrDbProperties[1].Split('=');
dbName = arrDbName[1].Trim().ToString();
serverName = arrServerName[1].Trim().ToString();
sqlFilePath = webConfigPath + "ICE2.1Temp\\ICE2.1\\SQL\\";
batchFile = webConfigPath + "ICE2.1Temp\\ICE2.1\\SQL\\Drop_DB2.1.bat";
Process proc = new Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = batchFile;
proc.StartInfo.Arguments = dbName + " " + serverName + " " + sqlFilePath;
proc.Start();
proc.WaitForExit();
proc = null;