ADO.NET Projects

ADO.NET Project 1

ADO.NET Examples


Using ADO.NET in Windows Forms
Previous Home Next

Formatting Data

The Binding object exposes two events, Format and Parse, both support for an application. The Format event occurs whenever data is pushed from the data source to the control, and when it is pulled from the control back to the data source.The Format event is used to translate the data from its native format to the format we to display to the use.The Parse event is used to translate it back to its original format and both events receive a ConvertEventArgs argument

ConvertEventArgs Properties
  1. The value property
  2. The desired property
  3. The Value property contains the actual data. When the event is triggered,the value property will contain the original data in its original format. To change the formatting, you set this value to the new data or format within the event handler. The DesiredType property is used when you are changing the data type of the value.


    Using the Format Event

    The Format event occurs both when data is being pushed from the data source and when it is pulled from the control, we must be sure we know which action is taking place before performing any action. If we change the data type of the value, we can use the DesiredType property to perform this check.

    Using the Parse Event

    the Parse event occurs when data is being pulled from a control back to the data source, and it is typically used to “un-format” data that has been customized for display. Because Parse is called only once, this “un-formatting” operation should always happen.

    Previous Home Next

    Tolal:0 Click:

    Show All Comments

    Did not find what you were looking for leave your name and message. We will revert within 24 hours
    Comment / Feedback: