Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2004, 09:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default DataBase Class

When someone says you should create a DataBase Class to handle all the database calls what exactly would I put in the class? Would it handle pages like the registration page and have the DataBase Class retrieve the txtFirstName and etc values?

 
Old July 29th, 2004, 11:35 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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
 
Old July 29th, 2004, 02:39 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

Peter, you meant Componentization?
building a class for evry table(just declaring one field for evry column in the Table) and build another unique class that manipulates these table classes and ....
Peter what is the meaning of UML(Unified Modeling Language) here and how I can find best articles about desining them I don't want to learn ADO.NET,ASP.NET,and.... I want to learn for example how I can design my Tables and relations between them and also how I can make a good componentization in the best manner?!!!)
do you know some good resorces about them?
Thanks in advance.


--------------------------------------------
Mehdi.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to customise class.database.php raoof PHP Databases 0 December 31st, 2007 11:48 AM
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Database Session Class sw8370 Pro PHP 0 February 4th, 2006 12:19 PM
help : Database class thy ADO.NET 2 June 9th, 2004 11:05 PM
How to include c# class and vb class in the .vbprj umeshayk VS.NET 2002/2003 2 January 9th, 2004 12:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.