Q&A
Q1: | I don't get it. Why doesn't a DataReader support databinding on Windows Forms? It seems like so much less code to write! |
A1: | It's true that using DataReaders amounts to writing less code. To bind to a control in Windows Forms, the class must expose the IList or IListSource interface of the System.ComponentModel namespace. A DataReader is an unbuffered stream of data that does not support these interfaces. |
Q2: | You kept mentioning scalability. How can I achieve maximum performance and scalability in my data access applications? |
A2: | Even though applications might be hindered by the hardware they're running on, writing efficient code also makes a big difference. Follow these tips to maximize your code performance:
|
Q3: | I keep getting errors when I attempt to reuse a connection object after I implement a DataReader. Why? |
A3: | Each time a DataReader is associated with a Connection object, the relationship is exclusive until you explicitly close the DataReader object using the Close method of the DataReader. Doing so releases the Connection object for reuse with another Command object.To get more information online, open the following link. It takes you to the Diving Into Data Access column of the Microsoft Developers Network (MSDN).http://www.msdn.microsoft.com/library/en-us/dndive/html/data06132002.aspThis series of articles gives you tons of great examples on different data access techniques, and discusses more advanced topics such as handling multiple tables in a DataSet and how to manage relationships in a DataSet. |