|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
OleDbParameter.Direction giving problemI am using visual basic.net (2003) with sql server 2000 as back end. For all my data access I am using stored procedures. I have a stored procedure to add/update a record. This stored procedure (sp hence forth) has various parameters; most of them input parameters, 2 output parameters, 1 returned value. One of the input parameters is '@OrgRV' - that is for Original Rowversion/timestamp which I am using for update to enforce optimistic concurrency; it goes in my where clause of the update statement. The stored procedure works fine. I have thoroughly tested it using debugger in sql server. However when I use a oledbdataadapter to submit my updates it gives me following error : Formal parameter '@OrgRV' was dfined as OUTPUT but the actual parameter not declared OUTPUT. I have written code that creates oledbdataadapter and all 3 (insert/update/delete) commands of a dataadapter. I use separate dataadapter for getting the data. I checked again and again all of my .net code and sp code. Nowhere I have defined @OrgRv as an output parameter. I tried both - explicitly setting @OrgRV parameter direction to parameterdirection.input and letting it implicitly take up the default value for direction which is input direction. I know problem is not in sp. I put very first statement in sp raiserror() and it doesn't raise that error. Sp has @OrgRV declared as an Input parameter. Worst part is, I used similar code for two of my other modules (of the same application) and they still work fine without any problem. Only this particular module is giving me problem. All of my modules are very consistent. I tried to change parameter name ( i know it is a dumb thing to do - but out of frustration and desperation...) and it gives me same same with the changed name. I think there is some problem with the 'FORMAL PARAMETER' which it says is defined as output. What is the difference between formal parameter and actual parameter? I guess my actual parameter is correct since the message says actual parameter is not declared as output. I also checked that it is not a spelling error - Zero digit used in place of alphabet O; but that also is not the case. Can someone Please........ help me solve the problem? Even if you don't have correct answer right away any suggestions would also help. I hope I have conveyed the problem correctly and at least some of the readers would be able to get what I have tried to explain. If required I can send a copy of my code too. -- tbj Shooting in the dark....are the parameters defined in the same order? Is one
of the input parameters a BLOB and NOT the last one defined? -- Show quoteBrad "tbj" wrote: > Hi all, > > I am using visual basic.net (2003) with sql server 2000 as back end. For all > my data access I am using stored procedures. I have a stored procedure to > add/update a record. This stored procedure (sp hence forth) has various > parameters; most of them input parameters, 2 output parameters, 1 returned > value. One of the input parameters is '@OrgRV' - that is for Original > Rowversion/timestamp which I am using for update to enforce optimistic > concurrency; it goes in my where clause of the update statement. The stored > procedure works fine. I have thoroughly tested it using debugger in sql > server. However when I use a oledbdataadapter to submit my updates it gives > me following error : > > Formal parameter '@OrgRV' was dfined as OUTPUT but the actual parameter not > declared OUTPUT. > > I have written code that creates oledbdataadapter and all 3 > (insert/update/delete) commands of a dataadapter. I use separate dataadapter > for getting the data. > > I checked again and again all of my .net code and sp code. Nowhere I have > defined @OrgRv as an output parameter. I tried both - explicitly setting > @OrgRV parameter direction to parameterdirection.input and letting it > implicitly take up the default value for direction which is input direction. > > I know problem is not in sp. I put very first statement in sp raiserror() > and it doesn't raise that error. Sp has @OrgRV declared as an Input > parameter. > > Worst part is, I used similar code for two of my other modules (of the same > application) and they still work fine without any problem. Only this > particular module is giving me problem. All of my modules are very > consistent. I tried to change parameter name ( i know it is a dumb thing to > do - but out of frustration and desperation...) and it gives me same same > with the changed name. > > I think there is some problem with the 'FORMAL PARAMETER' which it says is > defined as output. What is the difference between formal parameter and actual > parameter? I guess my actual parameter is correct since the message says > actual parameter is not declared as output. > > I also checked that it is not a spelling error - Zero digit used in place > of alphabet O; but that also is not the case. > > Can someone Please........ help me solve the problem? Even if you don't have > correct answer right away any suggestions would also help. > > I hope I have conveyed the problem correctly and at least some of the > readers would be able to get what I have tried to explain. > > If required I can send a copy of my code too. > -- > tbj |
|||||||||||||||||||||||