定义好存储过程的参数列表,并指定返回参数。
[
]
配置调用存储过程的XML标记:
[
]
调用页面的 C# 代码:
public string GetTradeCountByRegion(string regionID)
{
try
{
Hashtable ht = new Hashtable();
if (!string.IsNullOrEmpty(regionID))
ht.Add("RegionID", regionID);
ht.Add("Status", "9");
ht.Add("Total", 0);
return GetTradeService().GetTradeCountByRegion(ht);
}
catch (Exception ex)
{
throw ex;
}
}
调用Ibatis 返回输出参数数据:
public string GetTradeCountByRegion(Hashtable ht)
{
ExecuteQueryForList("Trade_Select_Count_Region", ht);
return ht["Total"].ToString();
}
调用很简单。[em]2[/em] 给新手参考。