|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TypedDataSet
{
class Program
{
static void Main(string[] args)
{
PersonTable table = new PersonTable();
table.PersonRowChanged += new PersonRowChangedDlgt(OnPersonRowChanged);
PersonRow row = table.GetNewRow();
table.Add(row);
}
static void OnPersonRowChanged(PersonTable sender, PersonRowChangedEventArgs args)
{
// This is silly example only for the purposes of illustrating using typed events.
// Do not do this in real applications, because you would never use this Changed event
// to validate row fields!
if (args.Row.LastName != String.Empty)
{
throw new ApplicationException("The row did not initialize to an empty string for the LastName field.");
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.