我写了一个SQl组合查询语句,代码超长,我用string 语句把SQl语句截取然后再加起来可以,但是太麻烦,谁有更好的方法可以实现在C#.NET中换行????这个问题每个人都需要把,呵呵求大家指点!

解决方案 »

  1.   

    @"SELECT
    *
    FROM
    TABLE_ABC
    WHERE
    ID = 1"
    前面加一个@就允许回车
      

  2.   

    private const string SQL_SELECT_SINGLERECORD=@"
    select 
     Hospitalname,Naturegradecode,Calltypecode,
     Storetypecode,Locationcode,Storedoctorcode,
     h.Provincecode,h.Citycode,Ismedicare,Headstorecode,
     Storesize,Monthlysales,h.Telephone,
     Homepage,Address,Postcode,
     Bestcallstarttime,Bestcallendtime,h.Memo,distributorname as HeadStoreName
    from  pub_hospital h left join pub_distributor on Headstorecode=distributorcode   where
     Hospitalcode=@Hospitalcode";