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.