Why are you declaring the parameter as InputOutput? Are you going to read
the parameter after the query is executed?
Isn't OleDbType.Char used for a fixed-length character field; should it be
VarChar? If you have a fixed-length field, put a space on the end of your
value, because it's only 9 characters.
Is your parameter name really QRYNAME?
How are you executing the stored procedure? There's no code here showing
that.
And you're missing a parentheses on the end of the "Dim cmd as New ..."
line, but I figured that was a typo.
What does your stored procedure look like?
Robin S.
---------------------------
"Darth Ferret" <no***********@nowhere.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
On the last statement below, I am getting this error -
'System.InvalidCastException'
Does anyone know what is causing this? I am trying to pass a parameter to
a stored procedure in an iseries. My connection opens and I can call a
stored procedure with no parameters. The problem is that I cannot pass
any parameters.
'create command object
Dim cmd As New iDB2Command(sql, cn
Dim cmdparm1 As New OleDb.OleDbParameter("QRYNAME", OleDb.OleDbType.Char,
10)
cmd.Parameters.Clear()
cmdparm1.Value = "SUNTR401A"
cmdparm1.Direction = ParameterDirection.InputOutput
cmd.Parameters.Add(cmdparm1)
Thanks in advance,
Joe in Florida