Hi NG,
the ExecuteScalar - Method of the DB2 Data Provider for .NET seems to work
different than
the ExecuteScalar - Method of the OleDB or the SqlDB Data Provider. I was
not able to return
the result value with the method invocation only (see # 1). (Did I something
wrong...?)
The result value could be only returned with # 2
Dim cn As DB2Connection = New DB2Connection(" bla bla bla")
cn.Open()
Dim rv as object
Dim cmd As DB2Command = cn.CreateComman d()
cmd.CommandText = "SP_USERlog On"
cmd.CommandType = CommandType.Sto redProcedure
Dim parm = cmd.Parameters. Add("p_Email", DB2Type.Char, 50)
parm.Direction = ParameterDirect ion.Input
parm.Value = "xyz@aol.co m"
parm = cmd.Parameters. Add("p_Password ", DB2Type.Char, 50)
parm.Direction = ParameterDirect ion.Input
parm.Value = "Password"
#1) rv = CType(cmd.Execu teScalar(), String) 'Neither works with OUT
Parameters nor with dynamic resultsets
#2) rv = CType(cmd.Param eters(0).Value, String) 'this returns the 1x1
Resultset only...
the ExecuteScalar - Method of the DB2 Data Provider for .NET seems to work
different than
the ExecuteScalar - Method of the OleDB or the SqlDB Data Provider. I was
not able to return
the result value with the method invocation only (see # 1). (Did I something
wrong...?)
The result value could be only returned with # 2
Dim cn As DB2Connection = New DB2Connection(" bla bla bla")
cn.Open()
Dim rv as object
Dim cmd As DB2Command = cn.CreateComman d()
cmd.CommandText = "SP_USERlog On"
cmd.CommandType = CommandType.Sto redProcedure
Dim parm = cmd.Parameters. Add("p_Email", DB2Type.Char, 50)
parm.Direction = ParameterDirect ion.Input
parm.Value = "xyz@aol.co m"
parm = cmd.Parameters. Add("p_Password ", DB2Type.Char, 50)
parm.Direction = ParameterDirect ion.Input
parm.Value = "Password"
#1) rv = CType(cmd.Execu teScalar(), String) 'Neither works with OUT
Parameters nor with dynamic resultsets
#2) rv = CType(cmd.Param eters(0).Value, String) 'this returns the 1x1
Resultset only...
Comment