I have to pass parameters to DTEXEC utility through ASP.NET code. I am using the process.start() method to trigger the SSIS package execution.
String 1
dtexec /file C:\ssis\pkg1.dtsx
/conn "MyConnectionManager";"\"Data Source=localhost\TestSQL2008R2;Initial Catalog=ConnDB;Integrated Security=SSPI;\""
String 2
/file C:\ssis\pkg1.dtsx
/conn "MyConnectionManager;Data Source=localhost\TestSQL2008R2;Initial Catalog=ConnDB;Integrated Security=SSPI;"
The above command line arguments are generated while manually executing the package through DTEXEC utility. However, I need to pass through this command line to process.start() method in ASP.NET using C#.
How can I represent the above command line within C# string statement? In other words, how do I escape the special characters by making use of @ character and pass a valid statement to process.start()?
A verbatim string literal is probably easiest to use for hard coding such strings.
You only need to double up every inner
":And:
With “regular” strings, you would need to escape each
"and\in the original with a\before them.