2
CREATE PROCEDURE DeletetblOfficeEquipmentProfileRecord
@OE_ID  varchar(11)
AS
BEGIN
DELETE FROM [EOEMS].[dbo].[tblOfficeEquipmentProfile]
WHERE [OE_ID]=@OE_ID
END
RETURN
GO

以上是我的sql存储过程我将如何在vb.net 2003中执行

此 SP 用于根据在文本框中选择的 OE_ID 删除记录

4

1 回答 1

3

您需要以下代码来执行存储过程

Imports System.Data.SqlClient

Dim conn as New SqlConnection(YourConnectionString)
Dim cmd as SqlCommand = conn.createcommand
conn.open()
cmd.CommandType = CommandType.StoreProcedure
cmd.Parameters.Add(New SqlParameter("@OE", YourValue)
cmd.CommandText = DeletetblOfficeEquipmentProfileRecord
cmd.ExecuteNonQuery() 
conn.close()
于 2013-04-25T04:16:05.793 回答