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.0Query Result been changedQuery Result been changed
Previous
 
Next
New Post
7/13/2007 10:41 AM
 

I am using DNN4.3/Sql Server 2005. invoking a stored procedure.

If I execute the stored procedure in sql server management studio, I get a result like this:

column1           column2            column3               column4                      column5

2006-07-13           2                     6300.00                     3                                25.20%

but If I invoke the same procedure from my code, I 'll get:

column1           column2            column3               column4                      column5

2006-07-13           2                     0                            0                                25.20%

you see, the result for column 3 and 4 have been changed to 0.

Here is my dataprovider:

Public MustOverride Function DailyTotalReportAfterEnd(ByVal ID As Integer) As IDataReader

Here is my sqldataprovider:

Public Overrides Function DailyTotalReportAfterEnd(ByVal ID As Integer) As IDataReader

Return CType(SqlHelper.ExecuteReader(_connection_sql, DatabaseOwner & ObjectQualifier & "GetDailyTotalAfterEnd", ID), IDataReader)

End Function

Here is my info class:

Public Class DailyTotalInfoForCompare

#Region "Private Members"

Private mDate As DateTime

Private mNewGivers As Integer

Private mTodayTotal As Decimal

Private mTodayCalled As Integer

Private mPercent As String

 

#End Region

#Region "Constructors"

Public Sub New()

End Sub

#End Region

#Region "Properties"

Public Property [Date]() As DateTime

Get

Return mDate

End Get

Set(ByVal Value As DateTime)

mDate = Value

End Set

End Property

Public Property NewGivers() As Integer

Get

Return mNewGivers

End Get

Set(ByVal Value As Integer)

mNewGivers = Value

End Set

End Property

Public Property TodayTotal() As Decimal

Get

Return mTodayTotal

End Get

Set(ByVal Value As Decimal)

mTodayTotal = Value

End Set

End Property

Public Property TodayCalled() As Integer

Get

Return mTodayCalled

End Get

Set(ByVal Value As Integer)

mTodayCalled = Value

End Set

End Property

Public Property Percent() As String

Get

Return mPercent

End Get

Set(ByVal value As String)

mPercent = value

End Set

End Property

#End Region

End class

here is my controller class:

Public class Controller

Public Function GetDailyTotalReportAfterEnd(ByVal ID As Integer) As DailyTotalInfoForCompare

Dim info As DailyTotalInfoForCompare = Nothing

Dim idr As IDataReader = Nothing

Try

idr = DataProvider.Instance().DailyTotalReportAfterEnd(ID)

info = CType(DotNetNuke.Common.Utilities.CBO.FillObject(idr, GetType(DailyTotalInfoForCompare)), DailyTotalInfoForCompare)

Finally

If Not idr Is Nothing Then

idr.Close()

idr.Dispose()

idr = Nothing

End If

End Try

Return info

End Function

end class

Now if I invoke the controller function from my code, like response.write(//the retruned info instance). I will find the result been changed to 0 as showed above.

Now I created another function and using connectionstring and sqlcommand directly to invoke the same stored procedure, everything is working fine.

Any one can see a problem?

thank you in advance.

 

 
New Post
7/13/2007 3:20 PM
 

There is probably an answer. I looked at it real quick and couldn't figure it out. For now you can just use a custom hydrator (not use the CBO)

http://www.adefwebserver.com/DotNetNukeHELP/Misc/Custom_Hydrator.htm



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
7/13/2007 4:05 PM
 

My first guess would be that your column name does not match your Public Property's name.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Query Result been changedQuery Result been changed


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