日期:2014-05-18  浏览次数:20673 次

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());
参考下