日期:2014-05-20  浏览次数:20595 次

|M| 字段太长可不可以用多行来显示
好我的sql
string   sql;
sql= "SELECT   *   FROM   (SELECT   MAX(id)   AS   id,   type   FROM   merchandise   GROUP   BY   type)   f   INNER   JOIN   (SELECT   c.id,   a.main,   b.kind,   c.name,   c.type,   c.present,   c.image   FROM   main   a   INNER   JOIN   merchandise   c   ON   a.id   =   c.main   INNER   JOIN   kind   b   ON   c.kind   =   b.id)   e   ON   f.id   =   e.id   ORDER   BY   f.id   DESC "

我不想用
sql= "********* "
sql+= "******* "这种方式
有没有   sql= "****************
                        ****************
                        **************** "这种方式

------解决方案--------------------
sql = @ " a b bs b c bz b ";
------解决方案--------------------
StringBuilder strSql=new StringBuilder();
strSql.Append( "insert into tb_s_user( ");
strSql.Append( "ID,LoginName,Password,UserName,UserSign) ");
strSql.Append( " values ( ");
strSql.Append( "@ID,@LoginName,@Password,@UserName,@UserSign) ");

strSql.ToString()