Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Output Parameter
Previous Previous
 
Next Next
New Post 1/12/2007 10:33 AM
User is offline davidfa
10 posts
10th Ranked


Re: Output Parameter 
 I am in the same problem, but with newer version 4.3.5 where it seems the core Users module is really using an output parameter along whith a returning result set in this call to a sproc:

UserController.GetUsersByProfileProperty(UsersPortalId, False, propertyName, Filter + "%", CurrentPage - 1, PageSize, TotalRecords)

The fact I can't re-implement it in my code is that I am missing the way the sqlDataProvider and controller should call for that resultset as for the output value.

Thanks for any help.

 
New Post 1/15/2007 12:20 AM
User is offline davidfa
10 posts
10th Ranked


Re: Output Parameter 

As for more recent release, working with DNN 4.3.5 and Net 2.0, I'm still having the same issue and can't see the light ..

Really the core has an sproc that is returning an output parameter along with a  recordset: UserController.GetUsersByProfileProperty()

I just can't figure out how to code it in the sqlDataProvider to get it work. Last try:

            Dim param_valor As New SqlParameter("valor", SqlDbType.NVarChar)
            param_valor.Value = valor
            Dim param_numPag As New SqlParameter("numPag", SqlDbType.Int)
            param_numPag.Value = numPag
            Dim param_llargPag As New SqlParameter("llargPag", SqlDbType.Int)
            param_llargPag.Value = numPag

            Dim param_TotalRecords As New SqlParameter("TotalRecords", SqlDbType.Int)
            param_TotalRecords.Direction = ParameterDirection.Output

            Return CType(SqlHelper.ExecuteReader(ConnectionString, GetFullyQualifiedName("GetPacientsByProp"), _
                New Object() {param_valor, param_numPag, param_llargPag, param_TotalRecords}), IDataReader)

            TotalRecords = CType(param_TotalRecords.Value, Integer)

 Thanks in advance for any help.

 

 
New Post 1/15/2007 8:53 PM
User is offline eck two
318 posts
8th Ranked


Re: Output Parameter 
 davidfa wrote

As for more recent release, working with DNN 4.3.5 and Net 2.0, I'm still having the same issue and can't see the light ..

Really the core has an sproc that is returning an output parameter along with a  recordset: UserController.GetUsersByProfileProperty()

I just can't figure out how to code it in the sqlDataProvider to get it work. Last try:

            Dim param_valor As New SqlParameter("valor", SqlDbType.NVarChar)
            param_valor.Value = valor
            Dim param_numPag As New SqlParameter("numPag", SqlDbType.Int)
            param_numPag.Value = numPag
            Dim param_llargPag As New SqlParameter("llargPag", SqlDbType.Int)
            param_llargPag.Value = numPag

            Dim param_TotalRecords As New SqlParameter("TotalRecords", SqlDbType.Int)
            param_TotalRecords.Direction = ParameterDirection.Output

            Return CType(SqlHelper.ExecuteReader(ConnectionString, GetFullyQualifiedName("GetPacientsByProp"), _
                New Object() {param_valor, param_numPag, param_llargPag, param_TotalRecords}), IDataReader)

            TotalRecords = CType(param_TotalRecords.Value, Integer)

 Thanks in advance for any help.

 



Maybe you forgot about editing the file DataProvider.vb to match your SqlProvider signature.
 
New Post 1/17/2007 10:34 AM
User is offline davidfa
10 posts
10th Ranked


Re: Output Parameter 

Thanks for your reply ecktwo.

I think I have it correct but not workink, declaring the thing this way:

A) in sqlDataProvider

 

Public Overrides Function GetPacientsByProp_OP(ByVal valor As String, ByVal numPag As Integer, ByVal llargPag As Integer, ByRef trCount As Integer) As IDataReader

 

param_valor.Value = valor

 

param_numPag.Value = numPag

 

param_llargPag.Value = llargPag

 

TotalRecords.Direction = ParameterDirection.Output

 

retorno =

 

trCount =

 

B) in dataprovider

 

C) the sproc is correctly functioning in QueryAnalyzer

It seems as previous post from this thread that "SqlHelper.ExecuteReader" is not treating output params. I read it consciously but as I can see DNN_core has something alike working when you get the paged list of users with the corresponding sproc with this call...

UserController.GetUsersByProfileProperty(UsersPortalId, False, propertyName, Filter + "%", CurrentPage - 1, PageSize, TotalRecords)

...so I thought someone could explain the solution about it.

(sure a solution is my little workaround calling 2 sprocs from one funcition in the controller class, but not nice...)

Public MustOverride Function GetPacientsByProp_OP(ByVal Propietat As String, ByVal valor As String, ByVal numPag As Integer, ByVal llargPag As Integer, ByRef TotalRecords As Integer) As IDataReader
Dim param_valor As New SqlParameter("valor", SqlDbType.NVarChar)Dim param_numPag As New SqlParameter("numPag", SqlDbType.Int)Dim param_llargPag As New SqlParameter("llargPag", SqlDbType.Int)Dim TotalRecords As New SqlParameter("TotalRecords", SqlDbType.Int)Dim retorno As IDataReaderCType(SqlHelper.ExecuteReader(ConnectionString, GetFullyQualifiedName("GetPacientsByProp_OP"), _New Object() {param_Propietat, param_valor, param_numPag, param_llargPag, TotalRecords}), IDataReader)CType(TotalRecords.Value, Integer)Return retorno
 
New Post 8/20/2007 5:04 AM
User is offline Oliver Ogg
11 posts
10th Ranked


Re: Output Parameter 

I've been trying to do something similar in my DAL+ layer.  In the end, I think I was having problems as I was using the DNN DataProvider ExecuteReader.  By using the Data Blocks from Microsoft directly it worked.  I believe this is because I could explicitly declare that the the CommandType was StoredProcedure.  This meant output parameters behaved correctly.

            SqlParameter[] searchParams = new SqlParameter[4];
           
            searchParams[0] = new SqlParameter("@term", SqlDbType.NVarChar, 256);
            searchParams[0].Value = searchTerm;

            searchParams[1] = new SqlParameter("@PageIndex", SqlDbType.Int);
            searchParams[1].Value = pageIndex;

            searchParams[2] = new SqlParameter("@NumRows", SqlDbType.Int);
            searchParams[2].Value = numRows;

            searchParams[3] = new SqlParameter("@EventCount", SqlDbType.Int);
            searchParams[3].Direction = ParameterDirection.Output;

 

List<EventInfo> events = DotNetNuke.Common.Utilities.CBO.FillCollection<EventInfo>((IDataReader)(
                SqlHelper.ExecuteReader("<my connection string>", CommandType.StoredProcedure, "Search_Event_Upcoming", searchParams)
                )
                );

eventCount = (int)searchParams[3].Value;

-----

And the output parameter eventCount was correct!

Thanks

 

 

 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Output Parameter
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Lucede Systems Group
Providing a full range of IT services for large and medium sized companies
www.lucede.com
Adaptive InfoSystems, Inc.
We provide custom programming and various levels of support for DotNetNuke and the .Net framework.
www.aisysweb.com
Multipartner Virtual Data Rooms
The Virtual Data Rooms (VDR) provided by an expert advisor, far from any ordinary software company!, supporting the sellers and their consultants. Multipartner builds and services higly professional Virtual Data Rooms (VDR) specifically tailored to M&A, Real Estate and NPL deals.
www.multipartner.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP