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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Output Params with DAL+ - is it possible?Output Params with DAL+ - is it possible?
Previous
 
Next
New Post
12/22/2008 3:57 PM
 

Thanks for the reply as usual Sebastian. Is this by design - could it be modified in the future to support output params? I think it is the most efficient way of querying data and returning values (I use it on all paging stored procs). If so then I will raise an enhancment request.


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
12/22/2008 7:30 PM
 

AFAIK it's like this as that's the design of the underlying Microsoft data access component, so to make an enhancement we'd probably have to add a new assembly (to avoid breaking 3rd party references) that supported output params as part of it's object model - something I'm guessing we'd be unlikely to do when there is a known workaround as Sebastian described - i could be wrong so please log your enhancement request, but I'm guessing it may not be changed. An alternative would be to code additional dal+ functions that didn't leverage the MS dac dal, perhaps that might be considered.


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
12/22/2008 7:39 PM
 

Rodney,

if you need to get a single value out out your sProc only, ExecuteScalar should fit your needs; you simply need to RETURN the value instead of using an OUT parameter. From my experience, this is most usual use case.

I just reviewed interface of MS DAAB, and ExecuteNonQuery should return Out Parameter, but unfortunately the calling method in DotNetNuke DataProvider passes the parameter collection by value. You might enter the request for out param support into our issue tracker, however, this looks difficult to correct w/o causing a breaking change.


Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
12/23/2008 12:13 PM
 

Hi there Rodney,

As it has been mentioned before, your best option to retrieve a single value is to use the ExecuteScalar method. If however, you need to retrieve more than a single value, or a combination of values and/or recordsets you can use the ExecuteReader command and then NextResult() method to advance to the next resultset.

This technique is used by the DNN pager control to retrieve both the records fetched AND the max number of records. You can check the GetUsers... SP and the pager control to get some guidance in how you can implement this for your own needs.

Cheers!

 
New Post
12/23/2008 3:08 PM
 

Rodney:

If you have gone the way of the DAL+ instead of the full DNN DAL, that means that you want to save some time, lines of code, and frustration, just like I do.  The DAL+ is fine, I was doing something like that even before DNN.  But, since ASP.Net 2.0 I started using the SqlDataSource Control and it works great.  You can use it against the default DNN database or a separate database.  In this way, you can also get support and samples from universal ASP.Net sources like this one and it works completely independent of the DNN implementation.

EDIT: Forgot to mention that I use the SqlDataSource strictly with Stored Procs with parameters, no dynamic SQL at all.  This is what I recommend you to do.

I hope I'm not flamed for heresy or blasphemy.

Carlos

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Output Params with DAL+ - is it possible?Output Params with DAL+ - is it possible?


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