Tamir SharpSsh RunCommand中的语法问题

时间:2016-07-24 14:19:20

标签: c# sql ssh syntax-error

我正在尝试在我的程序中编写以下代码行:

xxxx.RunCommand("echo "select count(*) from TABLE_NAME;"|sqlplus DB Connection");

现在我了解RunCommand的语法是RunCommand(“Unix Command”);

但是在我的程序中我需要使用多个“”。请在这里建议正确的代码。对不起这个基本问题。

1 个答案:

答案 0 :(得分:0)

如果您想要逃避它们,则需要使用\"代替。

xxxx.RunCommand("echo \"select count(*) from TABLE_NAME;\"|sqlplus DB Connection");

或者使用逐字字符串文字加倍。

xxxx.RunCommand(@"echo ""select count(*) from TABLE_NAME;""|sqlplus DB Connection");