loop out System.OutOfMemoryException
    Using VT As New BidiEntities
    
            For Each dr In Bidis
    
                Dim hkBidiAs New hkBidi
                hkBidi.UserId = Userx
                VT.AddTohkBidis(hkBidi)
    
            Next
    
            *VT.SaveChanges()*
    
        End Using

VT.SaveChanges got an error during. Loop in 500000 records.
loop out System.OutOfMemoryException
===

    Using VT As New BidiEntities
    
            For Each dr In Bidis
    
                Dim hkBidiAs New hkBidi
                hkBidi.UserId = Userx
                VT.AddTohkBidis(hkBidi)
    
            Next
    
            *VT.SaveChanges()*
    
        End Using

VT.SaveChanges got an error during. Loop in 500000 records.