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

What are the properties of datacontrol?

2034


how print barcode

2110


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

570


What are the forms of database?

533


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

725






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

520


Where to use new keyword other than create instance?

668


How to create a set up in vb.net for desktop application please say steps with examples?

533


What is form application?

530


Explain the difference between listindex and tab index?

548


What is the difference between desktop application and windows application?

492


Can you create a tabletype of recordset in Jet - connected ODBC dbengine?

1879


What is dynamic linking?

657


Which property is used to specify the use of an element in the user interface and reports it to the accessibility aids?

559


What are windows applications?

499