CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.microsoft_application_blocks Tags:
Item Type: NewsGroup Date Entered: 4/2/2004 1:32:50 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 1 Views: 27 Favorited: 0 Favorite
2 Items, 1 Pages 1 |< << Go >> >|
Tanus
Asp.Net User
Can some one verify this return value behaviour?4/2/2004 1:32:50 AM

0

G'Day,

I have a stored procedure that returns integer values according to the success of the procedure. ie RETURN 1, RETURN -1, RETURN 0 etc etc.

The procedure takes a few input paramters as well.

I setup the parameter arrays follows:

SqlParameter[] locParams = new SqlParameter[3];

locParams[0] = new SqlParameter("@in1",Value1);
locParams[1] = new SqlParameter("@in2",Value2);
locParams[2] = new SqlParameter("RetValue",SqlDbType.Int);
locParams[2].Direction = ParameterDirection.ReturnValue;

NB: It appears that it does not matter where you palce the returnvalue parameter either. All the reading I did into this matter said return parameters *have* to go first. I've succesfully run this code with the return parameter at index 0 and 2!

if I try to execute the command with:

SqlReader rdr = SqlHelper.ExecuteReader(getDBConnStr(),CommandType.StoredProcedure,"usp_TestProc",locParams)

everything is fine and I get the expected return value. However if I use:

SqlReader rdr = SqlHelper.ExecuteReader(getDBConnStr(),"usp_TestProc",locParams)

I get an error stating that I have too many parameters being passed into the procedure! Can anyone else verify this. Is this expected behaviour?

It took me a fair while to figure this one out. I was testing everything else to do with parameters, the procedure, parameter names and orders... everything but the way I was calling the procedure with the application block :) Thought I would put a post up in case someone else was having the same problem.

-James-








ericlandes
Asp.Net User
Re: Can some one verify this return value behaviour?4/5/2004 4:30:03 PM

0

I have seen this behaviour in the past, so even if it's not expected, it is consistent! I generally set the commandtype for just this reason every time I use this.
Eric Landes

MADNUG President http://www.madnug.net
Crystal Alliance Editor
Blog http://aspadvice.com/blogs/elandes
Microsoft MVP
2 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Fundamental approaches to software engineering: 6th international conference, FASE 2003, held as part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2003, Warsaw, Poland, April 7-11, 2003 : proceedings Authors: Mauro Pezzè, Pages: 402, Published: 2003
Beginning C# 2005 Databases Authors: Karli Watson, Pages: 501, Published: 2006
Component-based Software Engineering: 7th International Symposium, CBSE 2004, Edinburgh, UK, May 24-25, 2004 : Proceedings Authors: Ivica Crnkovic, LINK (Online service), Judith A. Stafford, Heinz W. Schmidt, Pages: 309, Published: 2004
Advances in Systems, Computing Sciences and Software Engineering: Proceedings of SCSS 2005 Authors: Tarek M. Sobh, Khaled Elleithy, SpringerLink (Online service, Pages: 437, Published: 2006
Implementation of functional languages: 12th international workshop, IFL 2000, Aachen, Germany, September 4-7, 2000 : selected papers Authors: Markus Mohnen, Pieter Koopman, Pages: 265, Published: 2001

Web:
Can some one verify this return value behaviour? - ASP.NET Forums Can some one verify this return value behaviour? Last post 04-05-2004 12:30 PM by ericlandes. 1 replies. Sort Posts: ...
Can some one verify this return value behaviour? - ASP.NET Forums Can some one verify this return value behaviour? Last post 04-05-2004 12:30 PM by ericlandes. 1 replies. Sort Posts: Oldest to newest, Newest to oldest ...
Mockito (Mockito API) Let's verify some behaviour! //Let's import Mockito statically so that ... By default, for all methods that return value, mock returns null, ... can call verifyNoMoreInteractions() but the first one is more explicit and can read better. ...
1.3.3. Chainable Mock Objects Specifying some behaviour with chainable mock objects is similar to ... In general, you will stub when you want to get some return value from a ... Every single invocation to one of your mock objects may be labeled with a unique identifier. .... After the tests have completed verify all conditions that are still ...
EasyMock 2.4 Readme Verifying Behavior. There is one error that we have not handled so far: If we ... For specifying return values, we wrap the expected call in expect(T .... Sometimes, it is necessary to have a Mock Object that checks the order of only some calls. ..... answers for expected calls can now be created at call time via ...


Videos:
www.moldytoaster.com ating, and which contained the trials of the commission on highways for the infraction of police regulations. He did not disturb himself on Javert ...
White House Press Briefing by Tony Snow (07-05-2006) Press Briefing by Tony Snow James S. Brady Briefing Room 12:19 P.M. EDT A full transcript can be found here: http://www.whitehouse.gov/news ...
AutoTest: Push-button testing using contracts Google London Test Automation Conference (LTAC) Google Tech Talks September 7th, 2006 Presenter: Andreas Leitner
Long Beach City Council Meeting Long Beach City Council Meeting
Long Beach City Council Meeting Long Beach City Council Meeting












problem with exception & logging application block

email tradelistener encodes message body?

daab cofigration setup qeustion

anyone know how to use the ms exception blocks?

problem accessing help file of enterprise library - january 2006

is updater block deprecated?

open excel file using daabaf (daab v3)

data migration from cryptography application block 1.1

a cached shopping cart ??

exception handling application block

daab - c# datetime parameter intto a smalldatetime field in the database conversion error

close connection using executedataset

enterprise library data access and oracle output parameter

newbie - problem finding application blocks dll

active directory using enterprise library

page reference in custom iexceptionhandler

microsoft.applicationblocks.exceptionmanagement and caching

throwing exception

problem installing rohservice.exe

configurationmanager

security problem

is following true or false?

eventlog error!

logging application block (entlib 2.0) - unable to write to event log with asp.net

the value of the property 'type' cannot be parsed.

file dependency implementation

data block

why sqlhelper didn't has a close method

beginner question - where in the web.config to put the connection string?

deploying exception handling block (enterprise library)

 
Search This Site:

 
  Privacy | Contact Us
All Times Are GMT