How to Insert a TextBox value in to Sql database using C#
coding?

Answer Posted / pranitha

first assign namespace like using system.data.sqlclient;

SqlCommand cmd = new SqlCommand("insert into emp
(EmpName,EmployeeCode,Designation,Location)values('" +
TextBox1.Text + "','" + TextBox2.Text + "','" +
TextBox3.Text + "','" + TextBox4.Text + "')");

Is This Answer Correct ?    51 Yes 33 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the purpose of session management?

733


Describe session handling in a webfarm?

760


Name the method that needs to be invoked on the dataadapter control to fill the generated dataset with data?

742


Explain asp.net page life cycle?

857


Give 2 examples for scenarios when routing is not applied?

812


What is the full meaning of asp.net?

729


What is caching in asp.net?

773


Define xmlvalidatingreader class.

838


Is redux flux?

741


Explain program to call the js function when the change is being made in the dropdown list made in asp.net mvc? : asp.net mvc

738


How is the asp.net mvc architecture different from others? : asp.net mvc

732


Which is the parent class of the web server control?

801


Which asp.net objects encapsulate the state of the client and the browser?

811


What is a session http?

719


What are the built-in objects in asp.net?

760