日期:2014-05-17  浏览次数:20702 次

c# sql 语句换行 送分 分 分
string strsql="update table set name1='aa' where id='bb';\r\n update table set name2='aa' where id='cc'"

这样执行的时候报错 提示 无效的字符,出错在“\r\n”
pl sql 输入 update table set name1='aa' where id='bb';\r\n update table set name2='aa' where id='cc' 会报错,必须写成两行
update table set name1='aa' where id='bb'
 update table set name2='aa' where id='cc'  


所以
strsql 中间怎么加换行啊 啊

------解决方案--------------------
string strsql=@"update table set name1='aa' where id='bb';
update table set name2='aa' where id='cc'";

拼字符串的话每个前都要加@

string strsql=@"update table set name1='aa' where id='bb';"+@"
update table
set name2='aa' where id='cc'";