paramNewReqID.Direction = ParameterDirection.ReturnValue should be
paramNewReqID.Direction = ParameterDirection.InputOutput in SQL Syntax the Return value is much like the return value of a function in VB or any other high level language it is generated solely by the function and is not passed in. when you are dealing with parameters you pass in to a stored proc and then want to read, you need to indicate this by saying they are inputoutput parameters. The Return value in SQLServer is usually only used to return error conditions. Now reading a scalar only reads the first column of the first row returned by a select statement in your stored proc. TO read a parameter you need to read the parameter after you execute the proc with a nonQUery Dim iRowsUpdated as Integer = cmSaveReq.SqlCommand.ExecuteNonQuery() Dim intNewReqID As Integer = cmSaveReq.Parameters(0) 'Could also use the name That should do it. HTH, -- Dean Fiala Very Practical Software, Inc http://www.vpsw.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
