zoukankan      html  css  js  c++  java
  • c#中长字符串换行

    有时候在代码中不得不写很长的一句sql语句。那么怎样才能换行使看起来很容易呢?

    最好的办法是用@符号.

    而@的意思就是告诉编译器,这里面的字符不需要转义,如下面的sql语句:  

    string SQL = @"select

                        a.numid,a.vc2title,

                        vc2type=case when a.vc2type='1' then '' when a.vc2type='2' then '' end ,

                        a.numuserid,datAdd=convert(varchar(10),a.datadd,111),a.vc2term ,b.vc2username

                   from T_supply a left join u_user b on a.numuserid=b.user_id

                   where a.vc2status='{0}'";

      SQL= string.Format(SQL,type);

  • 相关阅读:
    Qt 信号与槽
    Qt 项目中main主函数及其作用
    Windows下的GUI 库
    ABP进阶教程0
    ABP入门教程15
    ABP入门教程13
    ABP入门教程12
    ABP入门教程11
    ABP入门教程10
    ABP入门教程9
  • 原文地址:https://www.cnblogs.com/wenming205/p/1289945.html
Copyright © 2011-2022 走看看