G
Guest
Hi All,
I am trying to run following command to execute SQLCmd command in a seperate
process in a windows application. This SQLCmd command is intended to execute
SQL batch statements against the sql server database.
Process process = new Process ( );
process.StartInfo.Arguments = "-S psi-pc0183\\sql2k5 -U sa -P pwd -d DBName
-i CreateUDFs.sql -V1 -m1";
process.StartInfo.CreateNoWindow = false;
process.StartInfo.ErrorDialog = false;
process.StartInfo.FileName = "SqlCmd";
process.StartInfo.RedirectStandardOutput = false;
process.StartInfo.RedirectStandardError = false;
process.StartInfo.ErrorDialog = false;
process.StartInfo.UseShellExecute = true;
process.StartInfo.WorkingDirectory =
@"D:\CD\CD_50\Build\EplSetup\DataBaseSetup";
process.Start ( );
process.WaitForExit ( );
But, It is not responding. it is just hanging without any response
indefinitely. However, I am getting the desired result and process is working
properly in Console application.
Kindly suggest what should be the cause of this and any resolution of this
problem.
I am thankful to you in advance for whatever solution or workarounds you
have in your mind.
thanks again,
Pratik
I am trying to run following command to execute SQLCmd command in a seperate
process in a windows application. This SQLCmd command is intended to execute
SQL batch statements against the sql server database.
Process process = new Process ( );
process.StartInfo.Arguments = "-S psi-pc0183\\sql2k5 -U sa -P pwd -d DBName
-i CreateUDFs.sql -V1 -m1";
process.StartInfo.CreateNoWindow = false;
process.StartInfo.ErrorDialog = false;
process.StartInfo.FileName = "SqlCmd";
process.StartInfo.RedirectStandardOutput = false;
process.StartInfo.RedirectStandardError = false;
process.StartInfo.ErrorDialog = false;
process.StartInfo.UseShellExecute = true;
process.StartInfo.WorkingDirectory =
@"D:\CD\CD_50\Build\EplSetup\DataBaseSetup";
process.Start ( );
process.WaitForExit ( );
But, It is not responding. it is just hanging without any response
indefinitely. However, I am getting the desired result and process is working
properly in Console application.
Kindly suggest what should be the cause of this and any resolution of this
problem.
I am thankful to you in advance for whatever solution or workarounds you
have in your mind.
thanks again,
Pratik