Ciao ragazzi!
Ho creato questa classe che mi popola una listbox tenendo in memoria tutti i dati di ogni voce:
codice:
Public Class itemDataAssociati
Private m_visualizzazione As String
Public m_id As Integer
Public m_nome As String
Public m_cognome As String
Public m_fisso As String
Public m_tim As String
Public m_vodafone As String
Public m_wind As String
Public m_h3g As String
Public m_mail As String
Public m_ruolo As String
Public Sub New(ByVal visualizzazione As String, ByVal id As Integer, ByVal nome As String, ByVal cognome As String, ByVal fisso As String, ByVal tim As String, ByVal vodafone As String, ByVal wind As String, ByVal h3g As String, ByVal mail As String, ByVal ruolo As String)
m_visualizzazione = visualizzazione
m_id = id
m_nome = nome
m_cognome = cognome
m_fisso = fisso
m_tim = tim
m_vodafone = vodafone
m_wind = wind
m_h3g = h3g
m_mail = mail
m_ruolo = ruolo
End Sub
Public Overrides Function ToString() As String
Return m_visualizzazione
End Function
Public ReadOnly Property nomeAssociato() As Integer
Get
Return m_nome
End Get
End Property
Public ReadOnly Property cognomeAssociato() As Integer
Get
Return m_cognome
End Get
End Property
Public ReadOnly Property fissoAssociato() As Integer
Get
Return m_fisso
End Get
End Property
Public ReadOnly Property timAssociato() As Integer
Get
Return m_tim
End Get
End Property
Public ReadOnly Property vodafoneAssociato() As Integer
Get
Return m_vodafone
End Get
End Property
Public ReadOnly Property windAssociato() As Integer
Get
Return m_wind
End Get
End Property
Public ReadOnly Property h3gAssociato() As Integer
Get
Return m_h3g
End Get
End Property
Public ReadOnly Property mailAssociato() As Integer
Get
Return m_mail
End Get
End Property
Public ReadOnly Property ruoloAssociato() As Integer
Get
Return m_ruolo
End Get
End Property
End Class
Presumo funzioni perchè classi analoghe le ho già usate altre volte. Il problema è che spesso i campi che son utilizzati su sono Null nel mio db e questo fatto nn mi viene gestito con conseguente errore.
Come posso ovviare alla cosa?