B
Bruno Alexandre
Hi guys....
I must be doing something wrong, but What?
This code works fine:
--------------------------------------
strSQL = "SELECT * FROM utiUtentes WHERE idUtente = " & idUtente
With cmd
..Connection = conn
..CommandText = strSQL
..CommandType = CommandType.Text
End With
conn.Open()
------------------------------------------------
this won't!
------------------------------------------------
strSQL = "spGetUser"
With cmd
..Connection = conn
..CommandText = strSQL
..CommandType = CommandType.StoredProcedure
..Parameters("@idUser").Value = idUtente
End With
conn.Open()
-----------------------------------------------
the spGetUser store Procedure is this:
ALTER PROCEDURE [spGetUser]
@idUser as numeric
AS (
SELECT * FROM utiUsers WHERE idUser = @idUser
)
-----------------------------------------------
the variable idUser in VB code is a string type.
--
Bruno Alexandre
(Sintra, PORTUGAL)
I must be doing something wrong, but What?
This code works fine:
--------------------------------------
strSQL = "SELECT * FROM utiUtentes WHERE idUtente = " & idUtente
With cmd
..Connection = conn
..CommandText = strSQL
..CommandType = CommandType.Text
End With
conn.Open()
------------------------------------------------
this won't!
------------------------------------------------
strSQL = "spGetUser"
With cmd
..Connection = conn
..CommandText = strSQL
..CommandType = CommandType.StoredProcedure
..Parameters("@idUser").Value = idUtente
End With
conn.Open()
-----------------------------------------------
the spGetUser store Procedure is this:
ALTER PROCEDURE [spGetUser]
@idUser as numeric
AS (
SELECT * FROM utiUsers WHERE idUser = @idUser
)
-----------------------------------------------
the variable idUser in VB code is a string type.
--
Bruno Alexandre
(Sintra, PORTUGAL)