日期:2009-09-25  浏览次数:20513 次

[存储过程]

‘////////////////////////////////////////////////////////////////////////////////////

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")

 &nbs