Now that you are familiar with the extremely simple data model behind this application,
turn your attention to the
tag in the page, which controls all
interaction with the database. An ObjectDataSource control allows you to create a declarative
link between your web page controls and data access components that query and
update data. The control contains methods that describe how to select, insert, update,
and delete rows in the database. It??™s flexible and can work with many different components,
making it suitable for an application such as this one. This ObjectDataSource
control ties to a SQL Server Express Edition database that contains the tables for the
tasks and items lists. Note that most of the code for this tag can usually be auto
generated by Visual Studio because there are great design-time tools for configuring
the ObjectDataSource control (see Figure 6.11). You can view that tool by right-clicking
the ObjectDataSource control and selecting the Configure Data Source option.
CHAPTER 6 ?– USING SERVER CONTROLS IN ASP.NET AJAX 126
Figure 6-11.
Pages:
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201