Public Class Song

    Private mySongNumber As Integer
    Private myName As String
    Public Event DBError(ByVal message As String)

    Public Property SongNumber() As Integer
        Get
            Return mySongNumber
        End Get
        Set(ByVal value As Integer)
            mySongNumber = value
        End Set
    End Property

    Public Property Name() As String
        Get
            Return myName
        End Get
        Set(ByVal value As String)
            myName = value
        End Set
    End Property

    Public Function Exists(ByVal songnumber As Integer) As Boolean
        If SongTableAdapter.Exists(songnumber) > 0 Then
            Return True
        Else
            Return False
        End If
    End Function

    Public Function GetName(ByVal songnumber As Integer) As String
        Return SongTableAdapter.GetName(songnumber)
    End Function

    Public Function Item(ByVal songnumber As Integer)
        Dim tblTemp As DataTable
        tblTemp = SongTableAdapter.Find(songnumber)
        Dim drwTemp As DataRow
        drwTemp = tblTemp.Rows.Find(songnumber)
        Me.SongNumber = drwTemp("SongNumber")
        Me.Name = drwTemp("Name")
    End Function

    Public Function NumberOfSongs() As Integer
        Return CInt(SongTableAdapter.NumRows()) - 1
    End Function

    Public Function GetAll() As DataTable
        Return SongTableAdapter.GetData()
    End Function
End Class
