字符串太长换行的五种形式
1. 加个@,直接按回车
string sql =
@"
SELECT a.serv_name,a.acct_id,b.detail,c.customer_name
FROM serv a,address b,acct c
WHERE
a.acc_nbr = :acc_nbr
AND a.state <> 'F0X'
AND b.address_id = a.address_id
AND c.acct_id = a.acct_id
AND c.acct_seq_nbr = c.acct_seq_nbr
";
2.
string sql = "SELECT a.serv_name,a.acct_id,b.detail,c.customer_name";
sql += " FROM serv a,address b,acct c";
sql += " WHERE a.acc_nbr = :acc_nbr";
sql += " AND a.state <> 'F0X'";
sql += " AND b.address_id = a.address_id";
sql += " AND c.acct_id = a.acct_id";
sql += " AND c.acct_seq_nbr = c.acct_seq_nbr";
3.
string sql =
" SELECT a.serv_name,a.acct_id,b.detail,c.customer_name" +
" FROM serv a,address b,acct c" +
" WHERE" +
" a.acc_nbr = :acc_nbr" +
" AND a.state <> 'F0X'" +
" AND b.address_id = a.address_id" +
" AND c.acct_id = a.acct_id" +
" AND c.acct_seq_nbr = c.acct_seq_nbr";
4.
string strsql="select * from "
+"table "
+"where "
+"order by ";
5.
StringBuilder strsql = new StringBuilder();
strsql.Append("SELECT a.serv_name,a.acct_id,b.detail,c.customer_name");
strsql.Append(" FROM serv a,address b,acct c");
strsql.Append(" WHERE a.acc_nbr = :acc_nbr");
strsql.Append(" AND a.state <> 'F0X'");
strsql.Append(" AND b.address_id = a.address_id");
strsql.Append(" AND c.acct_id = a.acct_id");
strsql.Append(" AND c.acct_seq_nbr = c.acct_seq_nbr");
string sql =
@"
SELECT a.serv_name,a.acct_id,b.detail,c.customer_name
FROM serv a,address b,acct c
WHERE
a.acc_nbr = :acc_nbr
AND a.state <> 'F0X'
AND b.address_id = a.address_id
AND c.acct_id = a.acct_id
AND c.acct_seq_nbr = c.acct_seq_nbr
";
2.
string sql = "SELECT a.serv_name,a.acct_id,b.detail,c.customer_name";
sql += " FROM serv a,address b,acct c";
sql += " WHERE a.acc_nbr = :acc_nbr";
sql += " AND a.state <> 'F0X'";
sql += " AND b.address_id = a.address_id";
sql += " AND c.acct_id = a.acct_id";
sql += " AND c.acct_seq_nbr = c.acct_seq_nbr";
3.
string sql =
" SELECT a.serv_name,a.acct_id,b.detail,c.customer_name" +
" FROM serv a,address b,acct c" +
" WHERE" +
" a.acc_nbr = :acc_nbr" +
" AND a.state <> 'F0X'" +
" AND b.address_id = a.address_id" +
" AND c.acct_id = a.acct_id" +
" AND c.acct_seq_nbr = c.acct_seq_nbr";
4.
string strsql="select * from "
+"table "
+"where "
+"order by ";
5.
StringBuilder strsql = new StringBuilder();
strsql.Append("SELECT a.serv_name,a.acct_id,b.detail,c.customer_name");
strsql.Append(" FROM serv a,address b,acct c");
strsql.Append(" WHERE a.acc_nbr = :acc_nbr");
strsql.Append(" AND a.state <> 'F0X'");
strsql.Append(" AND b.address_id = a.address_id");
strsql.Append(" AND c.acct_id = a.acct_id");
strsql.Append(" AND c.acct_seq_nbr = c.acct_seq_nbr");