Friday 29 April 2016

Connection with SQL Server Part 5

SQLDataAdapter

  • DataAdapter serves as a bridge between a DataSet and SQL Server for retrieving and saving data. We can use SqlDataAdapter Object in combination with Dataset Object. DataAdapter provides this combination by mapping Fill method, which changes the data in the DataSet to match the data in the data source, and Update, which changes the data in the data source to match the data in the DataSet.


C#
  SqlDataAdapter adapter = new SqlDataAdapter(sql,connection );
adapter.Fill(ds);
  • The SqlDataAdapter Object and DataSet objects are combine to perform both data access and data manipulation operations in the SQL Server Database. When the user perform the SQL operations like Select , Insert etc. in the data containing in the Dataset Object , it wont directly affect the Database, until the user invoke the Update method in the SqlDataAdapter.
  • The DataAdapter can perform Select , Insert , Update and Delete SQL operations in the Data Source. The SelectCommand property of the DataAdapter is a Command Object that retrieves data from the data source. Other command properties of the DataAdapter are Command objects that manage updates to the data in the data source according to modifications made to the data in the DataSet.
  • The following ASP.NET program shows a select operation using SqlDataAdapter.

2 comments:

  1. thanks bro for these blogs............

    ReplyDelete
  2. 7289804105 rahul sir please contact me i have problem in asp.net

    ReplyDelete

Part 20 consuming rest api in ionic

in this video, I will show you that how you can consume the rest API. in the previous video we have implemented the asp.net web API projec...