Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 29th, 2004, 09:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 1,111
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?

  #2 (permalink)  
Old July 29th, 2004, 11:35 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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
  #3 (permalink)  
Old July 29th, 2004, 02:39 PM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
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.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:22 PM.


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