Groups | Blog | Home
all groups > dotnet framework > may 2007 >

dotnet framework : A simple enough problem


AlBruAn
5/31/2007 5:30:00 PM
I have a class I've written that works great as is; however, I now need to
add three additonal fields to it. One of the additional fields is an
integer, as is the case with the already existing field...actually, I guess
property would be the better name for it...anyway; the other two properties
are for date fields. Admittedly, my mind is a bit fried from a lot of
overtime, but I can't figure out how to modify this class for the life of me.
The code is as follows:

Imports System.Configuration
Imports System.Data.SqlClient
Imports Common.DataAccessLayer
Imports Common

Namespace Outreach

<Serializable()> _
Public Class CallEpisodes

#Region " Local variables "

Private _CallEpisodeIds As CallEpisodes

Private Shared _ConnectionString As String = _
ConfigurationManager.ConnectionStrings("EPSDTMain").ToString

#End Region

Sub New(ByVal CallEpisodeIds As CallEpisodes)

_CallEpisodeIds = CallEpisodeIds

End Sub

''' <summary>
''' Retrieves all the Call Episodes associated with a MemberID
''' </summary>
''' <param name="memberID"></param>
''' <returns>A list of all CallEpisodes for this MemberID</returns>
''' <remarks></remarks>
Public Shared Function RetrieveCallEpisodesByMemberId(ByVal memberID
As Integer)

Dim ce As New List(Of Integer)

Dim dr As SqlClient.SqlDataReader =
SqlDataAccess.ExecuteReader(_ConnectionString, _
"Outreach.RetrieveCallEpisodesByMemberId", memberID)

Do While dr.Read()
ce.Add(dr("CallEpisodeID"))
Loop

If dr IsNot Nothing Then
dr.Close()
End If

Return ce

End Function

End Class

End Namespace


How do I go about adding BeginDate, EndDate and ScriptID to this class such
that I can return the information?
Jon Skeet [C# MVP]
6/1/2007 12:00:00 AM
[quoted text, click to view]

Which bit of it is confusing you? Do you understand how the current
code works?

(One thing to note: your region of "local variables" is actually a
region of instance variables. Local variables are variables declared
within a method.)

--
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
AddThis Social Bookmark Button