当前位置: 代码迷 >> ASP.NET >> Append换行写如何写
  详细解决方案

Append换行写如何写

热度:4848   发布时间:2013-02-25 00:00:00.0
Append换行写怎么写?
比如 StrValues.Append("'" + TextboxA.Text + "','" + TextboxB.Text + "','" + TextboxC.Text + "'")
我想把Append里面的TextboxA.Text + TextboxB.Text + TextboxC.Text 写成  
 
TextboxA.Text + TextboxB.Text 
+TextboxC.Text 

也就是Append换行写
应该怎么写?


------解决方案--------------------------------------------------------
写成StrValues.AppendLine("'" + TextboxA.Text + "','" + TextboxB.Text + "'")
StrValues.AppendLine("'" + TextboxC.Text + "'")


------解决方案--------------------------------------------------------
Append是追加,AppendLine是追加一行,应该明白了吧


StrValues.AppendLine("'" + TextboxA.Text + "','" + TextboxB.Text + "'")
StrValues.AppendLine("'" + TextboxC.Text + "'")
------解决方案--------------------------------------------------------
StrValues.Append("'" + TextboxA.Text + "','" + TextboxB.Text + "','" + TextboxC.Text + "' + "\n"")
------解决方案--------------------------------------------------------
StringBuilder strSql = new StringBuilder();
strSql.Append("select T1.ID,T1.CustomerNo,T1.CustomerName,T1.CustomerDesc,T1.QuickInput,T1.CustomerType,T1.SalesUserID,T1.ContactPerson,T1.ContactTel,T1.ContactMail,T1.ContactAddress,T1.ContactFax,T1.FinalizedTerm,T1.FinalizedType from TB_Customer T1 where CustomerNo=T1.CustomerNo and CustomerName=T1.CustomerName");
if (CustomerNo.Length > 0)
{
strSql.Append(" and T1.CustomerNo like '%" + CustomerNo + "%'");
}
if (CustomerName.Length > 0)
{
strSql.Append(" and T1.CustomerName like '%" + CustomerName + "%'");
}

return DbHelperSQL.Query(strSql.ToString());
参考下