Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...DAL/BL and handling Output ParametersDAL/BL and handling Output Parameters
Previous
 
Next
New Post
4/7/2010 3:35 PM
 

Paul,

It is still returning 0 as my ID, it coudl be how I am assigning the returned value though. In my ASP page I have the following:

hidPreClaimID.Value = cntrlr.AddMedicalManagement(addPreClaim)

Does this work?

Chris

 
New Post
4/7/2010 3:41 PM
 
FYI: there is a known flaw in DAL, not properly handling output parameters.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
4/7/2010 3:54 PM
 

Chris,

Yes this should work.   To test - return a static value.  For example,  use "Return 1234"  in the stored procedure.  If you get a value of 1234 returned from the procedure then the issue is in the Stored Procedure, If you get 0, then you  know something is off with the code. 

I have used this method to return values all the time ... no issues.  

Another alternative, is to return the record just added.  Use the value to select the single record added.  Select ... where PreClaimID = @PreClaimID.  Then you can go back to using the ExecuteReader method like all the calls that returns data.

Paul.

 
New Post
4/8/2010 10:10 AM
 

Paul,

I did what you suggested with the static value, and I am still getting 0 as the value.So I will try to dig around the code and see if I can figure out what might be occuring.

With your alternative, do you mean going back to my original posted code with the parameterbeing added in the DAL Or do you not need and output parameter, as the ExecuteReader will insert the parameters and then return the data? Would I have to use IDataReader to do that?

 

Sebastian, Any idea when the flaw might be fixed?

 
New Post
4/8/2010 2:43 PM
 

Chris,  the second alternative I suggesting was not use any return value or variable at all.  Just have the stored procedure return the record just added.  This new record will contain the identity value as part of the fields returned.   Consider it  the same as combining the add and read functionality in one. 

So the end result is a simple ExecuteReader to read all the fields into the class, just like the read (or list) procedures.

As for the correction to the SQLHelper, I doubt that will happend as the SQLHelper function is defined in a dll supplied by Microsoft. 

To be honest, and just my opinion, with the move to SQL2005, the need for a provider model has been lost. I could see a complete rewrite using something like entity framework.  This would still allow people to use a different Database if required.  DNN 6?

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...DAL/BL and handling Output ParametersDAL/BL and handling Output Parameters


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out