i

ASP.Net A Complete Guide

SqlDataSource

This control represents a connection to the relational database like SQL Server or Oracle database. Connection to data is created using the two important properties, such as ConnectionString and ProviderName.

This example shows how to Select, Insert, and Update data from the database using SqlDataSource control with very less line of code.

Scenario for select data from a database.

Scenario for update data into a database:

Scenario for insert data into a database:

After setting up the data source, you can now display the data in a GridView control. In GridView control, we can set the DataSourceID property of the GridView control to the data source control we created above.