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

How should I destroy my objects in asp.net?

823


What is the life-span of the items in the viewstate?

731


How does viewstate work?

808


Which authentication uses a combination of windows and iis authentication?

824


What is postback request?

755


How are sessions stored?

775


What are the event handlers that we can have in global.asax file?

744


What is redirecting behavior?

744


Where the cookie value is stored?

732


What are the new features implemented in ASP.NET?

826


How do you implement sql caching in asp.net?

797


What is difference between cookies and cache?

785


Where are session variables stored?

748


List down the sequence of methods called during the page load.

732


What does aspcompat="true" mean?

771