return 之后,还要走UpCBZX(),为什么,各位大哥帮我看看吧!!
private string UpCBZX(string code, string name)
{
string UPName = name;
DBClass oraDb = null;
try
{
string connStr = System.Configuration.ConfigurationManager.AppSettings["BPMYW"];//连接字符串
oraDb = new DBClass(connStr);
string sqlStr = "select * from Public_CbzxItem where cfeecode='" + code + "' order by cfeeorder";
DataTable tbl = oraDb.GetDataSet(sqlStr).Tables[0];
if (tbl.Rows.Count > 0)
{
UPName = tbl.Rows[0]["cFeeName"].ToString() + "-->" + name;
if (tbl.Rows[0]["cFeeCode"].ToString() != "0")
{
UpCBZX(tbl.Rows[0]["cUPFeeCode"].ToString(), UPName);
}
//return UPName;
}
oraDb.clear();
}
catch (Exception ee)
{
if (oraDb != null && oraDb.Connection.State == System.Data.ConnectionState.Open)
{
oraDb.clear();//关闭连接;
}
}
return UPName;
}
------解决方案--------------------
if (tbl.Rows[0]["cFeeCode"].ToString() != "0")
{
UpCBZX(tbl.Rows[0]["cUPFeeCode"].ToString(), UPName);
}
这一段的意义是? 返回值也没有用到 =。=
不是
UPName=UpCBZX(tbl.Rows[0]["cUPFeeCode"].ToString()