Q&A

Q1:When using Visual Studio, must I use the properties approach to data binding for all my code?
A1: No; this chapter provided you with examples where either approach would work. All of the code contained in this chapter was also coded both ways.
Q2:Why don't you bind the Orders table in the DataGrid in the complex data binding example in this chapter?
A2: It was necessary to bind to the data relation in order to traverse the primary key to foreign key relationship within the DataSet (customer to orders). You want these to be coordinated in your display (the right orders for each customer). If you had bound to the Orders only, you would have a disconnected orders list. The code would run, but the results would be meaningless.

Get Sams Teach Yourself ADO.NET in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.