C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







commandBuilder


Posted Date: 09 May 2008      Total Responses: 3

Posted By: Musturu Thippa Reddy       Member Level: Silver     Points: 1


What is the use of command builder?




Responses

Author: shakti singh tanwar    09 May 2008Member Level: DiamondRating:     Points: 2
Command builder is used to automatically generate insert,update and delete commands from a data adapter that has a select command associated with it.

e.g

SqlConnection con = new SqlConnection("ConnectionString");
SqlCommand cmd = new SqlCommand("Select * from table",con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds, "table");
//make changes in dataset

SqlCommandBuilder builder = new SqlCommandBuilder(da);
da.Update(ds, "table"); //Will update the data from dataset to database





Author: swathi.chilumula    10 May 2008Member Level: GoldRating:     Points: 2
Command Builder will configure DataAdapter vth Insert, Delete, and Update statement....

// For saving the Record into DB //

SqlCommandBuilder cb = new SqlCommandBuilder(da);
MessageBox.Show(cb.GetInsertCommand().CommandText);
da.InsertCommand = cb.GetInsertCommand();
da.Update(ds, "table");
MessageBox.Show("Record Saved");


Author: karthekeyan    11 May 2008Member Level: DiamondRating:     Points: 2
www.radsoftware.com.au/articles/usingcommandbuilder.aspx


Post Reply
You must Sign In to post a response.
Next : data view,datalist
Previous : div
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



Read TATA Nano reviews.
dotNet Slackers   BizTalk Adaptors    Web Design   Scripts
Are you waiting for engineering entrance result? Watch here for engineering entrance results.
conference call definitions

Contact Us    Privacy Policy    Terms Of Use