ASP.NET
  Home arrow ASP.NET 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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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? 
ASP.NET

Database Storage with the ASP.NET Web Matrix: Update Page
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 16
    2005-10-18

    Table of Contents:
  • Database Storage with the ASP.NET Web Matrix: Update Page
  • Important Details and Updates
  • Calling the Function
  • Taking Care of 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: Update Page - Important Details and Updates


    (Page 2 of 4 )

       

    Some of these ID values may seem a little long, but whenever you find yourself application programming you should stick to the rule that anyone that hasn’t worked with you that has to debug your applications, should be able to do so easily and intuitively.  All elements should be labelled according to their specific functions in a consistent way.  If you looked at the code for an application for the first time that you were trying to update, and had a function that changed the value of a textbox, wouldn’t it be easier if you could pretty reliably guess what the textbox was called rather than figure out whether it’s textbox58 or not?   

    So anyway, your page should now look a little like this:

     

    Now switch to the code view and drag an UPDATE onto the page.  The UPDATE Data Code Wizard will open, and the database you are connected to will show.  Click the Next button to move on to the Construct section.  You need to tell it which column of the table you want to update; for this example, select the Password checkbox.  You now need to construct the Where clause; click the WHERE button and make sure Username is highlighted, then click Ok.

     

    Click the Next button twice and then give the function a name, such as updateUserPass and click Finish.  Your code will be created and placed on the page. 

    To provide the visitor with a success message, find the Finally statement of the Try code block near the bottom of the function you just created and add the following line after the call to close the database connection:

    lblSuccess.Text = "Password updated!"

    More ASP.NET Articles
    More By Dan Wellman


       · Hi all,Welcome to the fourth and penultimate article in the Web Matrix series. ...
     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek