jvcoach23 Posted January 15, 2006 Posted January 15, 2006 I'm using Vb 2005 and Sql 2005. I'm trying to use the ParameterDirection.inputout... and it's not working. With cm .Parameters.Add("@intTblWaitingListId", SqlDbType.Int).Value = mintTblWaitingListId .Parameters("@intTblWaitingListId").Direction = ParameterDirection.InputOutput end with cn.Open() cm.ExecuteNonQuery() when i trace this in sql.. this is what it is sending in declare @p1 int set @p1=8 exec spWaitingList_Save @intTblWaitingListId=@p1 output,@intTblCamperId=781,@intTblWeekId=1,@intPriority=0,@intMisses=0 select @p1 the set @p1=8.. the 8 seems to be the number of times I've tried running this for.. since it seems to increment each time I run it. now.. if I take comment out the .Parameters("@intTblWaitingListId").Direction = ParameterDirection.InputOutput then the value getting passed into @intTblWaitingListId is the value I want. anyone have any ideas... thanks shannon Quote JvCoach23 VB.Net newbie MS Sql Vet
Administrators PlausiblyDamp Posted January 15, 2006 Administrators Posted January 15, 2006 What is the value of mintTblWaitingListId when you are calling this? Also what does the code for spWaitingList look like? Also have you tried setting the direction before assigning a value? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
jvcoach23 Posted January 15, 2006 Author Posted January 15, 2006 What is the value of mintTblWaitingListId when you are calling this? Also what does the code for spWaitingList look like? Also have you tried setting the direction before assigning a value? The mintTblWaitingListId =0. i've checked while debuging and it is indeed 8. Here is the sp portion you'd be interested in i think ALTER procedure [dbo].[spWaitingList_Save] @intTblWaitingListId int=null OUTPUT ,@intTblCamperId int=null ,@intTblWeekId int=null ,@intPriority int=null ,@intMisses int=null No, i haven't tried telling the parm a direction before I do the add. guess i just figured that wouldn't work since I figured that you would have to add it before you coudl tell it that it had a direction... but I'll try it.. thanks shannon Quote JvCoach23 VB.Net newbie MS Sql Vet
jvcoach23 Posted January 15, 2006 Author Posted January 15, 2006 I tried this... .Parameters.Add("@intTblWaitingListId", SqlDbType.Int) .Parameters("@intTblWaitingListId").Direction = ParameterDirection.InputOutput .Parameters("@intTblWaitingListId").Value = mintTblWaitingListId Still no good.. here is the trace file and what was sent to sql server... declare @p1 int set @p1=10 exec spWaitingList_Save @intTblWaitingListId=@p1 output,@intTblCamperId=781,@intTblWeekId=1,@intPriority=0,@intMisses=0 select @p1 kind of weird.. thanks shannon Quote JvCoach23 VB.Net newbie MS Sql Vet
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.