1
好吧,我在這裏難倒 - 如下因素代碼中的錯誤與Procedure or function 'importsp_CreateDiallerBatch' expects parameter '@BatchName', which was not supplied
參數會在查詢中缺失
Dim cmd As SqlCommand = New SqlCommand()
cmd.CommandText = "importsp_CreateDiallerBatch"
cmd.Connection = cnSQL
cmd.Parameters.AddWithValue("@BatchName", BatchName)
Dim IdParameter As SqlParameter = New SqlParameter()
IdParameter.Direction = ParameterDirection.InputOutput
IdParameter.SqlDbType = SqlDbType.Int
IdParameter.Value = -1
IdParameter.ParameterName = "@BatchID"
cmd.Parameters.Add(IdParameter)
cnSQL.Open()
cmd.ExecuteNonQuery()
當調試代碼,BatchName肯定有一個值,並檢查CMD右側的參數集合執行前urey顯示了兩個參數,兩個參數均被命名並且其值完全按照預期設置。我必須寫這樣的代碼一千次 - 我錯過了什麼嗎?