I have the following Method:

Code:
Public Sub checkPlugins()
    'get the dll files
    Dim dllFiles As String() = Directory.GetFiles(Directory.GetCurrentDirectory() & "\Plugins")
    
    'read the table
    Dim dsRead As New DataSet()
    dsRead.ReadXml(Directory.GetCurrentDirectory() & "\Plugins.xml")
    
    Dim dtWrite As New DataTable()
    dtWrite.TableName = "Plugin"
    dtWrite.Columns.Add("Name")
    dtWrite.Columns.Add("Enabled")
    
    'loop through and add them to the writer
    For Each dllFile As String In dllFiles
        For Each dr As DataRow In dsRead.Tables(0).Rows
            If dllFile.ToString() = "test" Then
                dtWrite.Rows.Add(dllFile.ToString(), dr(1).ToString())
            Else
                dtWrite.Rows.Add(dllFile.ToString(), "True")
                
            End If
        Next
    Next
    
    
    'write the data
    dtWrite.WriteXml(Directory.GetCurrentDirectory() & "\Plugins.xml")
End Sub
Everything is working fine except for one part. The part where the second foreach loop runs. If I only have one plugin installed it puts 2 entries in the list. The reason is because it has 2 rows and it is adding it twice. I know what the issue is I just am drawing a blank right now. Any help is appreciated.