12.5. Practical Tips for Displaying and Updating Data
The following list provides some practical tips for displaying and updating data.
Always store your connection strings in the web.config file. Although it may seem easy to store them directly in the SqlDataSource in a page, you'll get in trouble when you need to make changes to your connection string later.
Always consider adding validation controls to your data entry pages. It makes it a lot easier for your users to find out what data is required, and in what format they should deliver it, while you protect your system from receiving and processing invalid or incorrect data.
If you have long lists of data to present, always consider turning paging on for controls like the GridView. Users tend to get lost if you present them with lists of over 50 items. Generally, a page size of somewhere between 10 and 20 items is best.
Consider renaming the controls in the page to something other than their default values. For example, in the previous Try It Out exercise you renamed SqlDataSource2 to sdsGenres. This makes it much easier to see which data source is needed to get information about the genres. With only a few controls in a page this isn't really an issue, but as soon as your page grows, it is increasingly important to choose distinguishing names for your controls.