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 request flow used for asp.net mvc framework? : asp.net mvc

726


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

717


How do cookies work?

774


Any disadvantages in Dataset and in reflection ?

3010


What is meant by server side scripting?

713


How about the security in Activex DLL and Activex EXE ?

2025


What is the displayafter property in updateprogress control?

730


what is command line compiler.what are the steps and how it is related to debugging.

1618


What does asax stand for?

748


What is page fragment caching?

725


What is the use of express session?

741


Is it possible to develop a single web application using ASP.NET webforms and ASP.MVC?

796


How asp.net mvc differs from asp.net web forms? : asp.net mvc

772


What is the web.config file in asp?

836


How tooltip is set through code-behind in ASP.NET?

833