怎么把存储过程绑定到DataList中让它显示
这是存储过程:create procedure RwardPointsRecord
@UserId int
as
declare @DeRp int
declare @LeaveRp int
declare @InRp int
declare @TotalRp int
set @TotalRp=(select sum(RewardPoints) from UserInfo where Id=@UserId)
set @InRp=(select sum(RewardPoints) from RpRecord where tag=1 and UserId=@UserId)
set @DeRp=(select sum(RewardPoints) from RpRecord where tag=2 and UserId=@UserId)
set @LeaveRp=@TotalRp+@InRp-@DeRp
select distinct(RpTime) as '日期',@InRp as '增加',@DeRp as '减少',@LeaveRp as '剩余',[Content] as '内容' from RpRecord
go
让它以 日期 增加 减少 剩余 内容 形式显示到DataList中 --------------------编程问答-------------------- DataList 绑定的数据源是 DataTable 或者 IList<T>
用 DataReader 执行存储过程,再用 DataTable.Load(DataReader)
将数据导入DataTable
最后用 DataList.DataSource = DataTable , 调用 DataList.DataBind() Render Html
补充:.NET技术 , ASP.NET