ASP中是怎么使用存儲(chǔ)過程的
發(fā)表時(shí)間:2023-08-11 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]Start!下面是創(chuàng)建存儲(chǔ)過程CREATE PROCEDURE select_forumASselect * from forum Goxx.aspx<%@ Page Language=&qu...
Start!
下面是創(chuàng)建存儲(chǔ)過程
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