在.net调用存储过程的另一种方法-asp.net教程
转载自:互联网 作者:cd3c.com
您正在看的asp.net教程是:在.net调用存储过程的另一种方法。
[存储过程]
‘////////////////////////////////////////////////////////////////////////////////////
CREATE PROCEDURE Test_procedure @cid int ,@y int, @n varchar(10) output
AS
select * from city where cid=@cid
if @y=1
begin
set @n = '成功!'
return 0
end
else
begin
set @n = '失败!'
return -1
end
GO
[程序中调用存储过程]
‘////////////////////////////////////////////////////////////////////////////////////
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim conn As OleDbConnection
Try
conn = New OleDbConnection("provider=sqloledb;data source=localhost;user id=sa;password=;initial catalog=jiang")
Dim cmd As New OleDbCommand(" {? = call Test_procedure(?,?,?)}", conn)
conn.Open()
[1] [2] [3] 下一篇
