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

Why do we need master page in asp.net?

522


What is the purpose of master page?

510


What is the biggest disadvantage of “Other Return Types” in Web API?

918


How can we use Web API with ASP.NET Web Form?

637


What are the differences between the response.write() and response.output.write()?

525






What is the benefit of WebAPI over WCF?

559


What are the security types in asp.net?

570


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

565


What does the hotspot class in .net do?

559


What are themes and skins in 2.0, explain usage scenario?

518


Describe a bubbled event and how it is used ?

609


Why is xap important?

588


What is a pixel url?

505


there is two functions function a and function b like fun a(){.... ..... } fun b() { } in function b i write the coding to add two numbers and i need to dispaly the sum result in function a with out using global variable. how we do?

2211


Is a dll file an executable?

539