Hi
I am starting a intranet project i want to make all three layers in my project initially i am making a login page so can anybody tell that how i will create a database layer and what code i have to write in database layer for login page.
please give code urgently.
Loading
Mamta MPosted Oct 12, 2011, 3:38 AM
You have to place all database related logic in the database layer. This means, for eg, you will have a class containing various methods to retrieve data from the database, and perform create, update, delete operations etc. So what you can do is create an ASP.NET folder in Solution explorer. Rename the folder as DAL (for data access layer). Create one or more classes in that folder and place the data logic in them. For eg, for login page, you can check if user id and password entered by the user in the text boxes is matching with data present in the database. But the DAL must not access the text boxes directly, so you can pass 2 strings to a method named LoginCheck for username and password and return a bool value indicating whether match was successfull or not. Call the LoginCheck method in the button click event of the Login page. This is a rough idea of how you can implement the logic.
Hope this helps.