How to use SQL data sources By Ramanjit

How to use SQL data sources By: Ramanjit Kaur(1595607) Presentation Id: 4 Page 416 -431

Outline: How to create a Select statement with the Query Builder? How to define the parameters? How to use the Data List control? How to define the templates for a data list? How to bind the controls in the template?

How to create a Select statement with the Query Builder? Query Builder generate SQL statement without knowing proper syntax. Diagram Pane: Used to display database tables Automatically join the two related tables. Grid Pane: It do sorting by selecting check box. SQL pane: It build the select statement and display it Result pane: It display the result by clicking Execute query button.


How to define the parameters? For defining parameters, specify the source of each value for parameters. A default value for the parameter can also be defined.

How to use the Data list control? Display the list of items from the data source. For defining the information in a data list, templates are used. For displaying data from column, use add a control to template. Data list control are used for editing and display operations.

How to define the templates for a data list? Template: What content to display and what control to use to display? Creating a template: - choose edit template from the smart tag menu for control to display the control in template editing mode. Adding a template: Click in template and begin typing Adding a control to template: drag the control from the toolbox onto the template, then use the properties window.

Common template elements:

How to bind the controls in the template? Select edit data binding option. Select property you want to bind. For applying format, select a format from the format drop down list. Eval method provides only for displaying data from the data source in control.

Reference: "Murach's ASP. NET 4 Web Programming with C# 2010 4 th Edition", Anne Boehm and Joel Murach, April 26, 2011. (ISBN 978 -1890774615). [Book Applications]

Thanks Any questions?
- Slides: 11