JAL Computing

C++COMProgramming .NET Mac Palm CPP/CLI Hobbies

 

Home
Up

Data Binding Classes

Download this C# ASP.NET project with contains prototype classes for simplified two way data binding of text boxes to a dataset including exception safe record view navigation. The project includes one interface "IGUIAdapter" and three classes: "TextBoxAdapter", "AdapterManager", "WebClass1".

This is a prototype project and as such contains unproven code and untested class designs. This project is for educational use only and no warranty is expressed or implied for any use of the concepts, classes or code contained in this project.

Adapter01.zip    Data Binding Project

/// <summary>/// 
Any data bound GUI adapter must implement this interface

///
to be managed by the AdapterManager
///
</summary>
public interface IGUIAdapter
{
    bool Update(DataRow dr);
    void DataBind(DataTable dt, int index);
    void Clear() ;
    string
ErrorMessage{get;}
    string
Key {get;}
}

/// <summary>
///
This is the manager classes that manages a collection of
/// data bound GUI adapters and supports exception safe record
/// navigation. To work properly, the AdapterManager must contain a
///
valid and populated data table prior to a calling any row navigation
/// method. This class is used to simplify data binding in a record view.
/// </summary>
public
class AdapterManager

/// <summary>
///
This is an adapter that associates a text box with a field name.
/// Any instance of this class can be added to the AdapterManager which
/// simplifies two way data binding of text boxes to a data table.
/// </summary>
public class TextBoxAdapter : IGUIAdapter

/// <summary>
///
Summary description for WebForm1.
/// This is a sample web project that demonstrates two way
/// databinding to a record view using bound TextBoxes and the custom
/// classes "AdapterManager" and "TextBoxAdapter". This sample
///
binds to the entire SQL7 Pubs Authors table. This technique
/// is not recommended for a large dataset since the entire table
/// is loaded into memory. Use custom paging for a large data table.
/// </summary>
public
class WebForm1 : System.Web.UI.Page

 
Send mail to [email protected] with questions or comments about this web site. Copyright © 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 © 
Last modified: 08/04/09
Hosted by www.Geocities.ws

1