when click insert grid view show me error: Must declare the scalar variable "@paymid"
sub insert :
Public Sub insert(ByVal per As Integer, ByVal datet As String, ByVal value As Integer)
Dim cmd As New SqlCommand
Dim da As New SqlDataAdapter
Dim query As String = "begin" & _
"declare @paymid int" & _
"exec @paymid=ctgetNextID 'Payments', @paymid" & _
"INSERT INTO Payments (paym_PaymentsID,paym_CreatedDate,paym_UpdatedDate" & _
",paym_TimeStamp,paym_value,paym_Date,paym_perc,paym_pipelineid) " & _
"VALUES(@paymid,getdate(),getdate(),getdate(),'" & value & "','" & datet & "','" & per & "' ) " & _
"End"
Dim con As New SqlConnection(getcon())
With cmd
.CommandType = CommandType.Text
...
Go to the complete details ...