how save recoreed in the database

Answer Posted / vishnu

System.Data.SqlClient.SqlConnection sqlConnection1 =
new System.Data.SqlClient.SqlConnection("YOUR CONNECTION
STRING");

System.Data.SqlClient.SqlCommand cmd = new
System.Data.SqlClient.SqlCommand();
cmd.CommandType = System.Data.CommandType.Text;
cmd.CommandText = "INSERT Region (RegionID,
RegionDescription) VALUES (5, 'NorthWestern')";
cmd.Connection = sqlConnection1;

sqlConnection1.Open();
cmd.ExecuteNonQuery();
sqlConnection1.Close();

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an example of form?

569


Which method grants a lock on a resource?

579


What are the advantages of form?

521


Name the property which is used to lock a textbox to enter data?

535


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

570






Where to use new keyword other than create instance?

668


What are window applications?

506


What are windows based applications?

540


What is form application?

530


What is a windows forms application?

521


What is difference between winforms and windows forms?

579


What is the full form of gac?

650


What is a database form?

495


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?

587


What are controls in windows forms?

536