Odbc Parameters Stored Procedure
Hi I am trying to execute a stored procedure and read the output values. I am getting a conversion error but I cannot figure out where its coming from. Here is the error:
Exception Details: System.Data.Odbc.OdbcException: ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Error converting data type nvarchar to int.
Source Error:
Line 39: conn.open()
Line 40:
Line 41: comm.ExecuteNonQuery()
Line 42:
Line 43: conn.close()
Here is the full source:
Dim comm as New ODBCCommand("{call jgrant_awcconnect..edit_equipment (?, ?, ?, ?, ?, ?)}", conn)
comm.parameters.add("@equipmentId", System.Data.SqlDbType.bigint)
comm.parameters("@equipmentId").Direction = ParameterDirection.Input
comm.parameters("@equipmentId").value = CInt(session("EquipmentId"))
comm.parameters.add("@Short", System.Data.SqlDbType.Nvarchar)
comm.parameters("@Short").Direction = ParameterDirection.Output
comm.parameters.add("@Long", System.Data.SqlDbType.Nvarchar)
comm.parameters("@Long").Direction = ParameterDirection.Output
comm.parameters.add("@Owned", System.Data.SqlDbType.Nvarchar)
comm.parameters("@Owned").Direction = ParameterDirection.Output
comm.parameters.add("@Job_Price", System.Data.SqlDbType.money)
comm.parameters("@Job_Price").Direction = ParameterDirection.Output
comm.parameters.add("@Job_Cost", System.Data.SqlDbType.money)
comm.parameters("@Job_Cost").Direction = ParameterDirection.Output
conn.open()
comm.ExecuteNonQuery()
conn.close()
txtShort.text = comm.parameters("@short").value
|