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

Answer Posted / premkumar.m

in asp.net webform,

first assign namespace like using system.data.sqlclient;

insert coding

sqlcommand cmd = new sqlcommand("insert into address values
('"+ textbox1.text +"', "+ textbox2.text +")",
connectionstring);

note:

Is This Answer Correct ?    145 Yes 56 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the two types of web pages?

711


What is asp.net futures?

763


What is a gridview in asp.net?

743


What is a session in programming?

756


What should you do is you want to remove an existing component but would like to make some funtionalities?

1732


State differences between MVC and WebAPI

827


How do I know asp.net mvc version? : Asp.Net MVC

733


Explain the difference between overriding and overloading?

742


Explain the difference between debug.write and trace.write? When should each be used?

759


What is difference between session and cookies?

770


What is a multilingual website?

769


What is autopostback true?

806


Explain the advantages of passport authentication.

696


How do you implement sql caching in asp.net?

776


Is it possible to create web application with both webforms and mvc?

730