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

is there any third party tools are using in .net technologies? what are there ? give me the brief introduction?

1924


How do you identify that the page is postback?

519


What is asp.net response object?

533


What is state management in .net?

573


How do we assign page-specific attributes?

589






What is HTTPModule and HTTPcontext? What is the use of each?

1965


Just by seeing the signature of the bean how can you specify whether it is a stateful or stateless session bean?

526


What are the new features implemented in ASP.NET?

580


What is the use of response redirect in asp.net?

553


Why do we use sessions?

551


How will create assesblies at run time?

535


What is the extension of master page in asp.net?

523


What is the difference between page-level caching and fragment caching?

507


What is session mode in asp.net?

498


What are the asp.net server side objects?

500