Binding Objects to Client-Side Controls.
This article is a continuation of Part 1 : Returning objects from a web service.
Windows form controls can easily be bound to either a single object or a collection of objects returned to the client by a web service.
This article demonstrates how to bind a object array to a DataGridView.The code for this demo can be downloaded here.
Steps.
Click Other Data Sources > Project Data Sources > Localhost > Account

This creates a BindingSource object named accountBindingSource.
myService = new localhost.Service();
accountBindingSource.DataSource=myService.getBankAccounts();

.NET has bound the object Array returned from the web service to the DataGridView.
It really is as simple as that!
Happy Coding!
technorati tags C# .NET, Object Binding


August 22nd, 2007 at 11:19 am
[…] and Views « Installing WAMP on Windows XP Home Edition. Binding Objects to Client-Side Controls. […]