Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a stored proc something like this:

 

Create proc AddAgent
@param1 varchar(20),
@param2 varchar(30)
As
Declare @Message varchar(200)

�.
Set @Message = �Some text�
Return @Message

When I call this proc from vb.net 2005 it returns an error saying:

 

"Conversion failed when converting the varchar value 'Some text' to data type int."

 

Any ideas? My guess is that it has something to do with the return statement

 

In VB the syntax for the parameter is the following:

 

Dim pMessage As New SqlParameter()
       pMessage.ParameterName = "@Message"
       pMessage.Direction = ParameterDirection.ReturnValue
       pMessage.SqlDbType = SqlDbType.VarChar
       pMessage.Size = 200
       sqlComm.Parameters.Add(pMessage)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...