Database
  Home arrow Database arrow Page 2 - 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
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 10
    2005-09-14

    Table of Contents:
  • Database Storage with the ASP.NET Web Matrix
  • Create a database and table
  • Setting up a registration page
  • Coding the page
  • Error message
  • Password security

  • 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 - Create a database and table


    (Page 2 of 6 )

    First then, you can create the database and table that will store the usernames and passwords of your visitors.  To do this, click on the Data tab on the right-hand side of the application and select the Add Database Connection button.  This will open the Add New Project dialogue box, where you can select the SQL Server database.  In the Connect to Database dialog box, click the link at the bottom entitled Create a new database.  You’ll be prompted to choose a name for the new database, so enter something relevant, like "members."  The connection will now show in the Data panel.

     

    To add a table to the database, in which to actually store the information, expand the new connection and highlight the tables folder.  Click the New Database Object button and enter a name for the table.  Again, use a name that makes sense, such as "logins."  The table interface will now be displayed.  We’ll keep it basic for this exercise and just create two columns -- one to store the usernames, and one to store the associated passwords.  The first column has been created for you; highlight it and click into the Name field.  Enter Username and then click into the DataType field.  A pointer will appear, allowing you to expand the selection.  Choose char.  Now click into the Size field and set a limit of 20 characters.  Finally, scroll down to the bottom and set the IsUniqueKey option to true, specifying that the table cannot contain duplicate Usernames.

    Click the New button to add another column, set the Name to Password and set the rest of the properties as above.

     

    Click the cross button in the top right-hand corner of the table interface to close the window.  You will get a message advising that no primary key has been set, but choose to save the table anyway.  This means that you will not be able to edit the data in the table, but for this basic example, you don’t need to.  Your new table will now appear under the tables folder of the database connection.

     

    More Database Articles
    More By Dan Wellman


       · Hi,This article explores the first of the built in Code Wizards that allow you...
     

    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

     
    Application Delivery: Everything You Wanted to Know, but Didn`t Know You Needed to Ask
    A comprehensive guide to examining the topics of Wide-area Data Services and app....

     
    Best Practices: Safe and Secure Hardware Asset Recovery
    Companies increasingly must meet EPA and local requirements for the disposal of ....

     
    Managing SSL Security in Multi-Server Environments
    Read this white paper to learn how to simplify management of your organization's....

     
    Open Source Security Myths
    Open Source Software (OSS) is computer software whose source code is available t....

     
    Power and Cooling Capacity Management for Data Centers
    This paper describes the principles for achieving power and cooling capacity man....

     




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