我要取到这个值
public bool GetjiangsuDlr(string name)
{
string str = "select COUNT (SCM_StockBillDtl.BillID) from SCM_StockBill,SCM_StockBillDtl,CP_DLR where CP_DLR.ID=SCM_StockBill.DEALERID and SCM_StockBill.BillID=SCM_StockBillDtl.BillID and 0<Qty and Qty<500 and CP_DLR.ID=(select ID from CP_DLR where [name]='" + name + "')and datediff(month,BillDate,getdate())<=12";
object obj = SqlHelper.ExecuteScalar(SqlHelper.jiangsu ,CommandType.Text,str);
if (Convert.ToInt32(obj) == 0)
{
return false;
}
else
{
return true;
}
}
应该怎么样改啊!qq99265117
------解决方案--------------------方法改改:
public string GetjiangsuDlr(string name)
{
string result="";
string str = "select COUNT (SCM_StockBillDtl.BillID) from SCM_StockBill,SCM_StockBillDtl,CP_DLR where CP_DLR.ID=SCM_StockBill.DEALERID and SCM_StockBill.BillID=SCM_StockBillDtl.BillID and 0<Qty and Qty<500 and CP_DLR.ID=(select ID from CP_DLR where [name]='" + name + "')and datediff(month,BillDate,getdate())<=12";
object obj = SqlHelper.ExecuteScalar(SqlHelper.jiangsu ,CommandType.Text,str);
if (Convert.ToInt32(obj) > 0)
{
result=obj.ToString();
}
return result;
}
取值:
CRMJiangsu.Number.StockbillDAl dal = new CRMJiangsu.Number.StockbillDAl();
Label2.Text = dal.GetjiangsuDlr(Session["name"].ToString()).ToString ();