ADO.NET tutorial for beginners
Lección 13 de 61 · Part 13 What is SqlCommandBuilder · Bases de datos
Part 13 What is SqlCommandBuilder
SqlCommandBuilder automatically generates INSERT, UPDATE and DELETE sql statements based on the SELECT statement for a single table.
For the Transact-SQL statements to be generated using SqlCommandBuilder, there are 2 steps
Step 1. Set the “SelectCommand” property of the SqlDataAdapter object
SqlDataAdapter dataAdapter = new SqlDataAdapter();
dataAdapter.SelectCommand = new SqlCommand(“SELECT_Query”, con);
Step 2. Create an instance of SqlCommandBuilder class and associate the SqlDataAdapter object created above using DataAdapter property of the SqlCommandBuilder object
SqlCommandBuilder builder = new SqlCommandBuilder();
builder.DataAdapter = dataAdapter;
Please Note: Step 2, can also be done in single line as shown below. Here, we are passing the SqlDataAdapter instance as an argument to SqlCommandBuilder class constructor
SqlCommandBuilder builder = new SqlCommandBuilder(dataAdapter);
Text version of the video
http://csharp-video-tutorials.blogspot.com/2013/10/part-13-what-is-sqlcommandbuilder.html
Slides
http://csharp-video-tutorials.blogspot.com/2013/11/part-13-what-is-sqlcommandbuilder.html
All ADO .NET Text Articles
http://csharp-video-tutorials.blogspot.com/p/free-adonet-video-tutorial.html
All ADO .NET Slides
http://csharp-video-tutorials.blogspot.com/p/adonet-slides.html
All Dot Net and SQL Server Tutorials in English
https://www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd
All Dot Net and SQL Server Tutorials in Arabic
https://www.youtube.com/c/KudvenkatArabic/playlists