; 预计c#转移并携带大字符串VS2012

ifo*_*ooi -2 c# sql sqlcommand string-concatenation visual-studio-2012

我有

CmdString = "insert into Team_table (name1, name2, result1, result2) (select t1.name,t2.name,NULL,NULL from teams t2 cross join teams t1)";
Run Code Online (Sandbox Code Playgroud)

我把它分成两列,按压输入就像输入一样

CmdString = "insert into Team_table (name1, name2, result1, result2) 
(select t1.name,t2.name,NULL,NULL from teams t2 cross join teams t1)";
Run Code Online (Sandbox Code Playgroud)

errore出现了

我怎么解决这个问题?

Til*_*lak 5

试试以下

CmdString = "insert into Team_table (name1, name2, result1, result2)" + 
" (select t1.name,t2.name,NULL,NULL from teams t2 cross join teams t1)";
Run Code Online (Sandbox Code Playgroud)

要么

CmdString = @"insert into Team_table (name1, name2, result1, result2) 
(select t1.name,t2.name,NULL,NULL from teams t2 cross join teams t1)";
Run Code Online (Sandbox Code Playgroud)