SQLHelper获取存储过程里面的return 和 ouput值

 SqlParameter p = new SqlParameter("@state", 1);
        SqlParameter returnn = new SqlParameter("@return", SqlDbType.Int);
        SqlParameter outPut = new SqlParameter("ouput", SqlDbType.Int);
        outPut.Direction = ParameterDirection.Output;
        SqlParameter[] sp = {
                                p,returnn,outPut 
                            };
        returnn.Direction = ParameterDirection.ReturnValue;
        SQLHelper.ExecuteNonQuery(SqlDataSource1.ConnectionString, CommandType.StoredProcedure, "testP", sp);
        int count = Convert.ToInt32(returnn.Value);
        int count1 = Convert.ToInt32(outPut.Value);

  

posted @ 2011-08-12 22:31  来了就看看  阅读(387)  评论(0编辑  收藏  举报