ASP中显示临时表中数据的问题?
我的存储过程是:
ALTER PROCEDURE moneycount
@sendman varchar(20)
AS
DECLARE @order int,
@name varchar(20),
@totol numeric(9),
@discount numeric(9),
@money numeric(9)
select @totol=count(*) from result where parm2=@sendman
select @totol
select @discount=discount from tbuser where uname=@sendman
select @money=@totol*@discount
select @money=@money/10
select @money
--select @money=@money+'元'
CREATE TABLE #t(x numeric,y numeric)
INSERT INTO #t VALUES (@totol,@money)
select * from #t
现在我要在ASP里把X,Y的值显示出来,请问怎么实现?
我的ASP代码是:
<%
set rs=server.createobject("adodb.recordset")
uname=trim(request.querystring("uname"))
sql="execute moneycount '"&uname&"'"
rs.open sql,conn,1,1
%>
<tr>
<td><table width="463" border="1" cellpadding="0" cellspacing="0" bordercolor="#0B62BB" style="BORDER-COLLAPSE: collapse" table>
<tr bgcolor="#DCFBFC" class="style3">
<td width="51" nowrap><div align="center" class="style3">留言者</div></td>
<td width="156" nowrap><div align="center" class="style3">留言总和</div></td>
<td width="129" nowrap><div align="center" class="style3">折扣</div></td>
<td width="157" nowrap><div align="center" class="style3">应收金额</div></td>
</tr>
<%if not rs.eof and not rs.bof then %>
<tr>
<td> <div align="center"><%=uname%></div></td>
<td><div align="center">该用户总共有<%=rs("x")%>条数据</div></td>
<td><div align="center"><%=rs("y")%></div></td>
<td><div align="center"> </div></td>
</tr>
<%
rs.movenext
end if
rs.close
%>
其中uname是有值的,用该值到SQL里面执行是有结果的,X=5,Y=5
为什么在网页里面就没有数据呢?
不知道这样调用是否有问题,请帮忙看看,谢谢!
ALTER PROCEDURE moneycount
@sendman varchar(20)
AS
DECLARE @order int,
@name varchar(20),
@totol numeric(9),
@discount numeric(9),
@money numeric(9)
select @totol=count(*) from result where parm2=@sendman
select @totol
select @discount=discount from tbuser where uname=@sendman
select @money=@totol*@discount
select @money=@money/10
select @money
--select @money=@money+'元'
CREATE TABLE #t(x numeric,y numeric)
INSERT INTO #t VALUES (@totol,@money)
select * from #t
现在我要在ASP里把X,Y的值显示出来,请问怎么实现?
我的ASP代码是:
<%
set rs=server.createobject("adodb.recordset")
uname=trim(request.querystring("uname"))
sql="execute moneycount '"&uname&"'"
rs.open sql,conn,1,1
%>
<tr>
<td><table width="463" border="1" cellpadding="0" cellspacing="0" bordercolor="#0B62BB" style="BORDER-COLLAPSE: collapse" table>
<tr bgcolor="#DCFBFC" class="style3">
<td width="51" nowrap><div align="center" class="style3">留言者</div></td>
<td width="156" nowrap><div align="center" class="style3">留言总和</div></td>
<td width="129" nowrap><div align="center" class="style3">折扣</div></td>
<td width="157" nowrap><div align="center" class="style3">应收金额</div></td>
</tr>
<%if not rs.eof and not rs.bof then %>
<tr>
<td> <div align="center"><%=uname%></div></td>
<td><div align="center">该用户总共有<%=rs("x")%>条数据</div></td>
<td><div align="center"><%=rs("y")%></div></td>
<td><div align="center"> </div></td>
</tr>
<%
rs.movenext
end if
rs.close
%>
其中uname是有值的,用该值到SQL里面执行是有结果的,X=5,Y=5
为什么在网页里面就没有数据呢?
不知道这样调用是否有问题,请帮忙看看,谢谢!
...全文
相关推荐
sql server创建临时表的两种写法和删除临时表
例如,当需要对大量数据进行分页查询时,可以先将数据加载到临时表中,然后对临时表进行分页,这样可以显著提升性能。
Oracle中的临时表讲解
这意味着在同一个事务内的多次操作可以共享数据,而其他事务无法看到这些数据。然而,由于数据在提交后被清除,因此这类表不适合用作最终的游标返回,因为.NET应用程序可能在访问时遇到问题。2.
asp.net+jquery显示数据+分页
在"asp.net+jquery显示数据+分页"这个主题中,我们将深入探讨如何利用这两种技术来展示大量的数据并实现分页功能。
asp 横排显示数据
完成上述修正后,整段ASP代码能够正常运行,实现数据库中数据的横向排列显示在网页表格中。需要注意的是,在实际应用中,还要考虑数据库连接安全性、错误处理以及动态生成内容对浏览器兼容性的影响等问题。
asp中command的在单条记录时,有些字段显示为空的问题
在处理单条记录时,可能会遇到某些字段显示为空的问题,这通常与查询语句、参数化查询、游标类型或者数据绑定方式有关。让我们深入探讨一下这些问题及其解决方案。首先,查询语句的编写是关键。


