Can anyone provide me a real life sample of how a DataPortal.BeginFetch with a data access that talks to a database and then send it back to a winForms grid, (if there is away to get this done)
Windows Forms doesn't natively understand async loading of data, so you will probably need some UI code to manage the process. Specifically, you'll need to set the bindingsource control to the new business object inside the callback from the BeginFetch.
For example:
private void Form1_Load(object sender, EventArgs e)
{
TestList.GetTestList((o, a) =>
{
if (a.Error != null)
{
MessageBox.Show(a.Error.Message);
}
else
{
this.testListBindingSource.DataSource = a.Object;
}
});
}
The implementation of the factory method and the DataPortal_XYZ method (or factory fetch method) are the same as in any of the samples or in the Using CSLA 4: Data Access book.
That's why I voted for a WinForms ebook
Copyright (c) Marimer LLC