这样可以
string temp="aaaaa"+
"bbbbb";

解决方案 »

  1.   

    string sSql="select a,b,adsf,agdasg,xczsd" + 
     " from sadfasd where asdf=asdfsa";
      

  2.   

    string sSql="select a,b,adsf,agdasg,xczsd\n"
        + "from sadfasd\n"
        + "where asdf=asdfsa";
      

  3.   

    string sSql=@"select a,b,adsf,agdasg,xczsd 
    from sadfasd 
    where asdf=asdfsa";前面加@ 即可然后即可直接回车了。
    vs2003 测试通过
      

  4.   


    若是字符串内换行。
    就用 + 号。
    如:
      string sSql="select a,b,adsf,agdasg,xczsd\n"
        + "from sadfasd\n"
        + "where asdf=asdfsa";
    其它,直接回车就行了。
        string sql = sql1 + sql2
                     + sql3;
      

  5.   

    用@就可以了
    例如 string strSql="this is a long text ";
    可以写成
    string strSql = @" this
      is 
       a 
      long 
      text ";
      

  6.   

    方法1
    string sSql="select a,b,adsf,agdasg,xczsd\n";
    sSql += "from sadfasd\n";
    sSql += "where asdf=asdfsa";
    方法2
    string sSql="select a,b,adsf,agdasg,xczsd\n"
        + "from sadfasd\n";
        + "where asdf=asdfsa";
    方法3
    string sSql=@"select a,b,adsf,agdasg,xczsd\n
             from sadfasd\n";
             where asdf=asdfsa";
      

  7.   

    string MySQL; 
    MySQL="select * from uses";
    MySQL+=" where username='"+xx+"' and ;  
    MySQL+="pwd='"+xx+"'";