I'm trying to execute a stored procedure using ODBC which has a parameter, but each time I do I get the following:
ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or function 'aaPRO_CloseCall' expects parameter '@FaultID', which was not supplied.
My code is:
Dim I As Integer = Convert.ToInt32(LogIDTextBox.Text)
Dim ConnString As String = "Dsn=Test"
Dim Conn As Odbc.OdbcConnection = New Odbc.OdbcConnection(ConnString)
Dim cmd As New Odbc.OdbcCommand("aaPRO_closecall", Conn)
cmd.CommandType = CommandType.StoredProcedure
cmd.Parameters.AddWithValue("@FaultID", I)
Conn.Open()
cmd.ExecuteNonQuery()
Conn.Close()
I'm new to Visual Studio and I can't see what I've got wrong. I'd be very grateful if anyone can help.
@names with ODBC, only question marks. See ODBC connection to MySQL won't add values. - GSerg