S
Steve Mauldin
I have data in a collection class of credit cards and I need to query it to
get only the records associated with a particular Personid. I was thinking
that there should be a dataadapter to use a collection as a datasource and
fill a dataset with the results. Do I have just wishful thingk or is this
possible? The collection class is posted below. Thanks for any input.
Steve Mauldin
Public Class AccountCreditCardCollection
Inherits CollectionBase
' Creates an empty collection.
Public Sub New()
End Sub 'New
Public Sub add(ByVal CreditCard As CreditCard)
list.Add(CreditCard)
End Sub 'Add
End Class
Public Class CreditCard
Private nCreditCardID As Long
Private nPersonID As Long
Private nPrimaryInd As Integer
Private sNickName As String
Private sCardName As String
Private sCardNum As String
Private dCardExp As Date
Public Sub New(ByVal pCreditCardID As Long, ByVal pPersonID As Long, ByVal
pPrimaryInd As Integer, ByVal pNickName As String, ByVal pCardName As
String, ByVal pCardNum As String, ByVal pCardExp As Date)
nCreditCardID = pCreditCardID
nPersonID = pPersonID
nPrimaryInd = pPrimaryInd
sNickName = pNickName
sCardName = pCardName
sCardNum = pCardNum
dCardExp = pCardExp
End Sub
Public Property CreditCardID() As Long
Get
Return nCreditCardID
End Get
Set(ByVal Value As Long)
nCreditCardID = Value
End Set
End Property
Public Property PersonID() As Long
Get
Return nPersonID
End Get
Set(ByVal Value As Long)
nPersonID = Value
End Set
End Property
Public Property PrimaryInd() As Integer
Get
Return nPrimaryInd
End Get
Set(ByVal Value As Integer)
nPrimaryInd = Value
End Set
End Property
Public Property NickName() As String
Get
Return sNickName
End Get
Set(ByVal Value As String)
sNickName = Value
End Set
End Property
Public Property CardNum() As String
Get
Return sCardNum
End Get
Set(ByVal Value As String)
sCardNum = Value
End Set
End Property
Public Property CardExp() As Date
Get
Return dCardExp
End Get
Set(ByVal Value As Date)
dCardExp = Value
End Set
End Property
End Class
get only the records associated with a particular Personid. I was thinking
that there should be a dataadapter to use a collection as a datasource and
fill a dataset with the results. Do I have just wishful thingk or is this
possible? The collection class is posted below. Thanks for any input.
Steve Mauldin
Public Class AccountCreditCardCollection
Inherits CollectionBase
' Creates an empty collection.
Public Sub New()
End Sub 'New
Public Sub add(ByVal CreditCard As CreditCard)
list.Add(CreditCard)
End Sub 'Add
End Class
Public Class CreditCard
Private nCreditCardID As Long
Private nPersonID As Long
Private nPrimaryInd As Integer
Private sNickName As String
Private sCardName As String
Private sCardNum As String
Private dCardExp As Date
Public Sub New(ByVal pCreditCardID As Long, ByVal pPersonID As Long, ByVal
pPrimaryInd As Integer, ByVal pNickName As String, ByVal pCardName As
String, ByVal pCardNum As String, ByVal pCardExp As Date)
nCreditCardID = pCreditCardID
nPersonID = pPersonID
nPrimaryInd = pPrimaryInd
sNickName = pNickName
sCardName = pCardName
sCardNum = pCardNum
dCardExp = pCardExp
End Sub
Public Property CreditCardID() As Long
Get
Return nCreditCardID
End Get
Set(ByVal Value As Long)
nCreditCardID = Value
End Set
End Property
Public Property PersonID() As Long
Get
Return nPersonID
End Get
Set(ByVal Value As Long)
nPersonID = Value
End Set
End Property
Public Property PrimaryInd() As Integer
Get
Return nPrimaryInd
End Get
Set(ByVal Value As Integer)
nPrimaryInd = Value
End Set
End Property
Public Property NickName() As String
Get
Return sNickName
End Get
Set(ByVal Value As String)
sNickName = Value
End Set
End Property
Public Property CardNum() As String
Get
Return sCardNum
End Get
Set(ByVal Value As String)
sCardNum = Value
End Set
End Property
Public Property CardExp() As Date
Get
Return dCardExp
End Get
Set(ByVal Value As Date)
dCardExp = Value
End Set
End Property
End Class