AD (Active Directory) is a directory service provider (a system that provides authentication, directory, policy, and other services in a Windows environment).
LDAP (Lightweight Directory Access Protocol) is a protocol designed for directory service providers for querying and modifying items in directory service providers like AD, which supports a form of LDAP.
In other words, you use LDAP for retrieving information from AD.
Now, if you need to implement an authentication of intranet users against Windows domain (AD) then you need to read about Integrated Windows Authentication. To enable it typically you need
and optionally enable integrated windows authentication in IE. Read more here
Once done, user will be automatically logged in without entering his login name or password. You will be able to get his identity (User.Identity.Name) and other properties from AD.
This is a secure form of authentication which you can see when using SharePoint, Outlook Web Access or similar intranet applications.
Can i get any sample code to work with as this concept is very new to me?
Does LDAP authenticate username and password from the databse or only Active Directory Username and Password
When talking about Integrated Windows Authentication, your application does not need to have any database of users and their passwords. You even does not require to have any login form as all will go automatically. There is also no programming code required. If you are still in doubt about it, give more details on your requirements.
I am developing one application where User log in to the system using its Username and Password that has been saved into the database.but i want that the username and password must be authenticated using LDAP..
Still not clear why you need to enter login/password if it can be done without it. See example msdn.microsoft.com/en-us/library/ff650308.aspx