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

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

558


How do I change the console application in windows?

505


Explain how save rerecord in the database?

597


Which property of the errorprovider control automatically sets to the form to which?

554


Explain how to add resources during runtime?

611






How insert record in the database?

604


Is form action required?

518


Suppose I have two combobox .. And I have some items in both combobox now I need to check the item in both combobox if same item is present in both combobox I need to display that item in message box?

588


What is form record?

540


What is a windows form application?

544


Explain how to split a column header in gridview using c#.net?

557


What is an example of form?

569


Where to use new keyword other than create instance?

671


How save rerecord in the database?

597


Name the template that is used to create a user-defined component.

521