Usually when we say this we mean this:
Make a class that contains the logic to call the database and handle the various aspects of data manipulation. Use this as the layer between the database itself and the UI. This class shouldn't deal with UI issues, only data issues. For example:
Public Class MyDataLayer
Public Shared Function LoginUser(ByVal username As String, ByVal password As String) As Boolean
'Use "username" and "password" variables
'as your criteria for the SQL call here
'
'Call database
'Provide return result
End Function
End Class
Now your UI layer (the aspx page) will call this from the Login button click handler:
If MyDataLayer.LoginUser(txtUserName.Text, txtPassword.Text) Then
'User is logged in, handle accordingly
Else
'User is NOT logged in, handle accordingly
End If
|