查看: 788|回复: 1
|
VISIO STUDIO 的疑问
[复制链接]
|
|
CREATE PROCEDURE TASK_Get_Single_Item
(
@NID int
)
AS
SELECT * FROM tbl_TASK WHERE NID = @NID
GO
这是我在MS SQL里 STORED PROCUDERES,不知为什么我RUN 就会有下面这ERROR
出现,我谁可以帮我看看吗。。。
System.Data.SqlClient.SqlException: Procedure 'TASK_Get_Single_Item' expects parameter '@NID', which was not supplied.
以下是我code
Sub Bind()
Dim SQLString = ("server=(local);database=DB1;trusted_connection=yes")
Dim myConnection As New SqlConnection(SQLString)
Dim myCommand As New SqlCommand("TASK_Get_Single_Item", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim parameterNID As New SqlParameter("@NID", SqlDbType.Int, 4)
parameterNID.Value = Request.Querystring("NID")
myCommand.Parameters.Add(parameterNID)
Dim myDataReader As SqlDataReader
myConnection.Open()
myDataReader = myCommand.ExecuteReader()
myDatareader.Read() |
|
|
|
|
|
|
|
发表于 24-3-2006 08:10 PM
|
显示全部楼层
Dim parameterNID As New SqlParameter("@NID", SqlDbType.Int, 4)
parameterNID.Value = Request.Querystring("NID")
myCommand.Parameters.Add(parameterNID)
Change to the below coding:
Dim parameterNID As SqlParameter
parameterNID = New SqlParameter("@NID", SqlDbType.Int, 4)
myCommand.Parameters.Add(parameterNID) |
|
|
|
|
|
|
| |
本周最热论坛帖子
|