alt
Advertisement

Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow ASP.NET 2.0 arrow ASP.NET 2.0 Free Tutorials : SqlDataSource Control
Site Search
Sponsored Links



ASP.NET 2.0 Free Tutorials : SqlDataSource Control
Article Index
ASP.NET 2.0 Free Tutorials : SqlDataSource Control
Page 2

.

.

On clicking continue the user is prompted to select an existing data source or to click change to change the data source or provider. The user has to also enter the name of the new database or an existing data base. Name the new database as ExForSys and click Test Connection.

If the connection is successful the user gets a message to the effect that he has been successfully connected. The connection is then displayed in the Configure data Source box.

The next string prompts the user to save the connection string to the application configuration file. The user has to click on the check box if ‘yes’ and then click Next.

The next screen prompts the configuration of the Select Statement. Now the user has to specify a custom SQL statement or stored procedure or specify columns from a table or view. Click Next to continue.

The next screen requires the user to define custom statements or stored procedure. The screen helps the user create commands for each operation that has to be supported in the database such as select, update, insert or delete.

For instance a select statement can be entered by the user as shown in the screen as under or the help of the query builder can be taken to create the SQL statement.

The query can be tested and the results of the query will be displayed in the preview screen of the wizard. Once the preview is complete the user can click finish to complete the process of configuring the database.

The user is now taken back to the DataSource configuration wizard screen that requires him to select the data field to display in the drop down list and within that a data field for the value of the drop down list. Once the user has selected the required data, he has to click OK to continue.

The user is now taken back to the Design view of the Visual Studio IDE with the control displaying that it is DataBound and that the data source is SqlDataSource with the SqlDataSource1. A number of new options have been added to the DropDownList Task menu.

ASP.NET 2.0 offers a codeless way of incorporating data into a web application. The data source controls can be declaratively and automatically instantiated and IDataSource and IHierarchicalDataSource can be used to allow data sources and data controls to work together efficiently. The consistent model of data representation enables developers to control data access and is also consistent with the old methods of accessing data. The data also has become accessible across a variety of sources while the page developer can use the same model of data access irrespective of the data source he is accessing. In the next lesson we shall explore in greater detail some of the data bound controls that take advantage of codeless binding.


Trackback(0)
Comments (0)add comment

Write comment

busy

 
< Prev   Next >
Sponsored Links
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape