Can anyone see what I am doing wrong?
Code:
1 Public Function CustomGetEventsByRange(ByVal ModID As Integer, _
2 ByVal StartDate As DateTime, _
3 ByVal EndDate As DateTime) As IDataReader
4
5 log.Debug("Modules: " & ModID.ToString)
6 log.Debug("BeginDate: " & StartDate.ToString)
7 log.Debug("EndDate: " & EndDate.ToString)
8
9 Try
10
11 Dim parms As esParameters = New esParameters()
12 parms.Add("Modules", ModID)
13 parms.Add("BeginDate", StartDate)
14 parms.Add("EndDate", EndDate)
15
16 Return (Me.ExecuteReader(esQueryType.StoredProcedure, "dbo.dnn_EventsGetByRange", parms))
17
18 Catch ex As Exception
19 log.Debug("Error: " & ex.Message)
20 Return Nothing
21 End Try
22
23 End Function
This results in an error:
2008-02-04 19:35:44,717 DEBUG BusinessObjects.DnnEventsCollection - Modules: 390
2008-02-04 19:35:44,717 DEBUG BusinessObjects.DnnEventsCollection - BeginDate: 1/22/2008 12:00:00 AM
2008-02-04 19:35:44,717 DEBUG BusinessObjects.DnnEventsCollection - EndDate: 3/11/2008 12:00:00 AM
2008-02-04 19:35:44,742 DEBUG BusinessObjects.DnnEventsCollection - Error: Value cannot be null. Parameter name: key
The SP does work:
exec
dbo.dnn_EventsGetByRange @Modules=N'390',@BeginDate='2008-01-22 00:00:00:000',@EndDate='2008-03-11 00:00:00:000'
returns 2 rows.