G
Guest
I'm testing OleDbCommand for calling a store procedure in a Sybase DB
I'm using an output parameter but always I get DBNull
here is my code:
Dim conn As New OleDbConnection(connStr)
Dim cmd As New OleDbCommand("HO_ProcTest", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim workParam As OleDbParameter
cmd.Parameters.Add("@firstDate", OleDbType.DBTimeStamp)
cmd.Parameters("@firstDate").Value = Date.Now
workParam = cmd.Parameters.Add("@Out", OleDbType.Integer)
workParam.Direction = ParameterDirection.Output
Try
conn.Open()
cmd.ExecuteNonQuery()
Dim str = cmd.Parameters("@Out").Value()
Catch ex As Exception
Finally
conn.Close()
End Try
obviously the store procedure is fine I test it,
From my point of view this is a bug.
Any Solution??
Thanks
I'm using an output parameter but always I get DBNull
here is my code:
Dim conn As New OleDbConnection(connStr)
Dim cmd As New OleDbCommand("HO_ProcTest", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim workParam As OleDbParameter
cmd.Parameters.Add("@firstDate", OleDbType.DBTimeStamp)
cmd.Parameters("@firstDate").Value = Date.Now
workParam = cmd.Parameters.Add("@Out", OleDbType.Integer)
workParam.Direction = ParameterDirection.Output
Try
conn.Open()
cmd.ExecuteNonQuery()
Dim str = cmd.Parameters("@Out").Value()
Catch ex As Exception
Finally
conn.Close()
End Try
obviously the store procedure is fine I test it,
From my point of view this is a bug.
Any Solution??
Thanks