在.net中接收存储过程返回的值
点击次数:65 次 发布日期:2008-11-06 08:13:10 作者:源代码网
|
源代码网推荐
源代码网整理以下getCon(); //连接数据库的方法 int id = 35; SqlParameter[] par = new SqlParameter[2]; par[0] = new SqlParameter("@id", SqlDbType.Int); par[0].Value = id; par[1] = new SqlParameter("@count", SqlDbType.Int); par[1].Direction = ParameterDirection.Output; //设置为输出参数 SqlHelper.ExecuteNonQuery(con, CommandType.StoredProcedure, "getChildCount", par);
源代码网整理以下 this.Label1.Text = par[1].Value.ToString(); //接收输出的参数 存储过程代码如下: create proc getChildCount @id int, @count int output as select @count=babycount from yangsCMS_Article_Class where id=@id order by treekey 源代码网推荐
源代码网供稿. |