| |
|
|
|
|
|
|
|
|
|
 |    |  |
 | |  |
 | |  |
 | |  |
 | |  |
 |
|
|
|
| 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.
|
|
|
|
 |  |
|
|
|
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.
|
|
|
|
 |  |
|
|
|
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. |
|
|
|
 |  |
|
|
|
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 IDataReaderDim 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 |
|
|
|
 |  |
|
|
|
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
|
|
|
|
|  |
 | |  |
 | |  |
 | |  |
|  |
| |
 |
|
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.
|
| |
 |
|
|
|
|
|
|
|