executereader error

  • Thread starter Thread starter MSNEWS
  • Start date Start date
M

MSNEWS

I get this error when trying to run a SQL command, maybe my program is
silly, I'm pretty new at this :

Additional information: SqlCommand.Prepare method requires all variable
length parameters to have an explicitly set non-zero Size.

selcmd.Connection = con

selcmd.CommandText = "SELECT identcol FROM resumeconv_directories"

selcmd.Parameters.Add("@directoryname", SqlDbType.Char)

selcmd.Parameters("@directoryname").Direction = ParameterDirection.Input

selcmd.Parameters("@directoryname").Value = thedirectory

selcmd.Parameters.Add("@identcol", SqlDbType.Int)

selcmd.Parameters("@identcol").Direction = ParameterDirection.Output

selcmd.Prepare()

selcmd.ExecuteReader()

MsgBox(selcmd.Parameters("@identcol").Value)
 
Back
Top