Ok, I'm stumped here - the folowing code errors with 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()
When debugging the code, BatchName definitely has a value, and checking the parameters collection of cmd right before executing the urey shows 2 params, both named and with values set exactly as expected. I must have written code like this a thousand times - am I missing something here??