Command builder
Brief describe command builder class work.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jul 17, 2012, 6:42 AM EDT
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 17, 2012, 7:48 PM EDT
hi,
It automatically generates single-table commands that are used to reconcile changes made to a DataSet with the associated SQL Server database.
This class automatically registers itself as an event listener to the RowUpdating event. Whenever data inside a row changes, the object of the CommandBuilder class automatically generates a SQL statement and uses the SelectCommand property to commit the changes made in DataSet.
DataSet dset = new DataSet();
SqlConnection con = new SqlConnection("myConnectionString");
//Autogenerate Insert, Update & Delete commands
SqlDataAdapter adp = new SqlDataAdapter("Select from table1", con);
SqlCommandBuilder scb = new SqlCommand(adp);
//Fill the dataset
da.Fill(dset,"table1");
please refer
http://vb.net-informations.com/dataadapter/dataadapter-commandbuilder-sqlserver.htm
hope this will help you.