急,急,存储过程输出参数调用问题??
public SqlParameter[] DealwithCrimeCount=new SqlParameter[3];
public void GetDealwithCrimCount(DateTime timeStart, DateTime timeEnd)
{
{
DealwithCrimeCount[0] = new SqlParameter("@DealwithCrimeCount1",SqlDbType.Int,4);
DealwithCrimeCount[1] = new SqlParameter("@DealwithCrimeCount2", SqlDbType.Int, 4);
DealwithCrimeCount[2] = new SqlParameter("@DealwithCrimeCount3", SqlDbType.Int, 4);
};
DealwithCrimeCount[0].Direction = ParameterDirection.Output; //为存储过程的输出参数
DealwithCrimeCount[1].Direction = ParameterDirection.Output;
DealwithCrimeCount[2].Direction = ParameterDirection.Output;
DataSet ds = this.dbProcessor.RunProcedure("Cup_Work_GetDealwithCrimecount", DealwithCrimeCount, "GetDealwithCrimeCount");
DataTable dt = ds.Tables["GetDealwithCrimeCount"];
}
其中DealwithCrimeCount[0],DealwithCrimeCount[1],DealwithCrimeCount[2]是存储过程Cup_Work_GetDealwithCrimecount里的输出参数,我将他放在数组DealwithCrimeCount里,现在我想在本页面调用这几个输出参数,怎么写啊??望指教??
------解决方案--------------------执行完后,
DealwithCrimeCount[0] 就有值了.
------解决方案--------------------int x=(int)DealwithCrimeCount[0].value
------解决方案--------------------int Data=(int)DealwithCrimeCount[0].value
------解决方案--------------------dt1.Rows.Add(new object[] { "合计",DealwithCrimeCount[0].value.ToString() );
------解决方案--------------------http://www.cnblogs.com/pengpeng614/archive/2008/08/29/1279720.html
------解决方案--------------------听不懂吗 public static SqlParameter[] DealwithCrimeCount=new SqlParameter[3]; 试试看