G
Guest
Hi,
I am using System.Diagnostics,Process.Start
to execute sqlcmd.exe
the second parameter of the Start method is the arguements to pass to sqlcmd
Because I am using SQLExpress the string contains "MachineName\\SQLExpress"
the \\ is there becase of escape clauses, etc.
It is causing my method to fail.
How do I go from \\ to \ in a string so I can pass the string as a parameter
to the Start method??
I have played with @"" string literals and string.format and \u0000 but I am
getting nowhere
your help appreciated
string sSQLcmd = string.Format(@"-S {0} -d {1} -i ""Tables Functions
Sprocs.sql"" -o ""SQL Script1 Output.txt""", sSQLdataSource, sSQLdataBase);
where sSQLdataSource = "machineName\\SQLexpress"
so I can
Process p = Process.Start("sqlcmd", sSQLcmdArguement);
Thanks
Charlie
Sydney
Oz
I am using System.Diagnostics,Process.Start
to execute sqlcmd.exe
the second parameter of the Start method is the arguements to pass to sqlcmd
Because I am using SQLExpress the string contains "MachineName\\SQLExpress"
the \\ is there becase of escape clauses, etc.
It is causing my method to fail.
How do I go from \\ to \ in a string so I can pass the string as a parameter
to the Start method??
I have played with @"" string literals and string.format and \u0000 but I am
getting nowhere
your help appreciated
string sSQLcmd = string.Format(@"-S {0} -d {1} -i ""Tables Functions
Sprocs.sql"" -o ""SQL Script1 Output.txt""", sSQLdataSource, sSQLdataBase);
where sSQLdataSource = "machineName\\SQLexpress"
so I can
Process p = Process.Start("sqlcmd", sSQLcmdArguement);
Thanks
Charlie
Sydney
Oz