读书人

c# sql 话语换行 送分 分 分

发布时间: 2012-09-28 00:03:35 作者: rapoo

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'";

读书人网 >C#

热点推荐