Link to home
Start Free TrialLog in
Avatar of AlexPonnath
AlexPonnathFlag for United States of America

asked on

VB.Net Data Class

I am looking for some help using a Data Class more effectively. I have multiple classes for example Students
Public Class Student
        Public Property StudentID() As Integer
            Get
                Return m_StudentID
            End Get
            Set
                m_StudentID = Value
            End Set
        End Property
        Private m_StudentID As Integer
        Public Property StudentName() As String
            Get
                Return m_StudentName
            End Get
            Set
                m_StudentName = Value
            End Set
        End Property
        Private m_StudentName As String
        Public Property StudentClass() As String
            Get
                Return m_StudentClass
            End Get
            Set
                m_StudentClass = Value
            End Set
        End Property
        Private m_StudentClass As String

        Public Property UniqueId() As String
            Get
                Return m_guid
            End Get
            Set
                m_guid = Value
            End Set
        End Property
        Private m_guid As String
    End Class

Open in new window

Now i set the values like this
 Dim myData As New Nodes.Student

        myData.StudentName = "Tom Smith"
        myData.StudentID = "1234567890"
        myData.StudentClass = "VB.NET"

Open in new window

So here is what i am trying to do  can i get easily all data fields in mydata ? how idealy i would like to loop thru all and only use the ones with data . I want to use only propertys where the value <>"" and then create a string like

"property: 'Value', property: 'value'"
ASKER CERTIFIED SOLUTION
Avatar of Nitin Sontakke
Nitin Sontakke
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial