当前位置:首页 > 网络编程 > 软件语言 > .NET > ASP中是如何使用存储过程的

ASP中是如何使用存储过程的

点击次数:64 次 发布日期:2008-11-06 07:51:27 作者:源代码网
源代码网推荐
广告载入中
Start!
下面是创建存储过程
CREATE PROCEDURE select_forum
AS
select * from forum
Go
xx.aspx
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQL" %>
<%
dim conn as SQLConnection
dim cmd as SQLCommand
dim myreader as SQLDataReader
conn=new SQLConnectio("server=localhost;uid=sonysce;pwd=1netsg;database=1net")
cmd=new SQLCommand("select_forum",conn)
cmd.CommandType=CommandType.StoredProcedure
conn.Open()
cmd.Execute(myreader)
while myreader.Read()
Response.Write(myreader("content")&"<br>")
end while
myreader.Close()
conn.CLose()
%>
End


源代码网推荐

源代码网供稿.
网友评论 (0)
会员中心
网络编程
本站推荐
网络编程之精华