I always use
directory service APIs[
^] instead of LDAP-to-DB mapping: it's a lot more direct, because it does not force LDAP concepts into a framework designed for relational DBs.
Here[
^] is a good example in C#. Microsoft documentation has short examples in VB as well.