how save recoreed in the database

Answer Posted / venky

string cns=@"server=.\SQLEXPRESS;Database=emp;Integrated Security=SSPI";

cn=new SqlConnection(cns);

string sql = "select * from mytable";
DataSet ds = new DataSet();
SqlDataAdapter adpt=new SqlDataAdapter(sql,cn);

adpt.Fill(ds,"emp1");

.....after altering table....

sqlcommandbuilder cbdr=new sqlcommandbuilder(adpt);

adpt.Update(ds,"emp1");

your changes automaically save into databases...

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Name the two main categories of .net components.

607


Explain the difference between listbox and combo box?

587


Explain how many number of events does the timer controls?

607


Which method grants a lock on a resource?

682


What is form and its uses?

586






how see report periviwe

2414


What is a windows based application?

615


How is anchoring different from docking?

685


Name the class to be inherited for creating a custom control.

651


What are windows based applications examples?

626


Name the method that has to be overridden to change the appearance of the control that is inherited from an existing control.

656


Which window displays messages for the status of various features provided in the visual studio .net ide?

636


What are controls in windows forms?

618


Explain something about crystal report in brief?

624


What is form design?

630