Database
  Home arrow Database arrow Page 3 - Database Storage with the ASP.NET Web Matr...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
DATABASE

Database Storage with the ASP.NET Web Matrix: Simple Login Page
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 28
    2005-09-21

    Table of Contents:
  • Database Storage with the ASP.NET Web Matrix: Simple Login Page
  • Start with the Properties pane
  • Switch to the Code view
  • Encrypting the password
  • Do you want to use a template?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Database Storage with the ASP.NET Web Matrix: Simple Login Page - Switch to the Code view


    (Page 3 of 5 )

    Switch to the Code view in the Web Matrix and drag a SELECT function onto the page to launch the Select Code Wizard dialog box.  Make sure the members database is selected and click the Next button.  In the Columns panel of the next window, check the Username tick box, then click the Where button.  The Where Clause Builder will already be set correctly, so just click Ok.  Click the Next button twice and then set a name for the function, such as checkUserName, make sure the DataSet radio is selected, and click Finish.  This will add the first of our SELECT functions to the page. 

    To create the second SELECT function, drag another SELECT onto the page; this time, choose both the Username the Password tick boxes and in the Where Clause Builder dialog, select Username in the Left Operand Column panel and click Ok.  Now click the And Clause button and this time, choose Password as the Left Operand and click Ok. Click the Next button twice and then set the function name to checkUserPass.  Again, ensure the DataSet radio is selected.

    The following screenshot shows the vast amount of code that the Wen Matrix has just written for you:

    To call these functions and check the user’s information, go back to the Design view in the Web Matrix, and double-click the Submit button.  This will add a click event to the Code view.  Go back to the Code view, and in the Sub add the following code:

    lblUsernameError.Text = ""
    lblPasswordError.Text = ""
    lblWelcome.Text = ""

    These three lines of code simply reset the messages when the Submit button is clicked so that, if a user enters an incorrect name on the first attempt, whichever error message is displayed gets switched off the next time the submit button is clicked.  Otherwise, if a user submits an incorrect username or password before submitting a correct username and password, the error message will be displayed with the welcome message.

    More Database Articles
    More By Dan Wellman


       · Hi everybody, this is the second in a so far four part series exploring the built...
     

    DATABASE ARTICLES

    - Excel Reference
    - Database Programming in C# with MySQL : Usin...
    - Formatting Techniques for Data Access from E...
    - Data Access from Excel VBA
    - Generating a Multiple Table Crystal Report u...
    - ADO and the Command Object
    - On Wiring Up an ADO Data Control
    - Reading and Writing to Files on the Intranet
    - Using ADO Record to Create and Navigate Intr...
    - Using Data Access Pages to Access Data on a ...
    - Using ADO with the SQL Native Client
    - ADO`s Stream Object
    - Opening a Record Object Referencing an Open ...
    - Introducing Jasper (SQL Anywhere 10 Beta)
    - Creating a Database Project in VS 2005





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT