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 use of web.config and machine.config files?

630


Explain the function of new view engine in asp.net? : asp.net mvc

527


What is application session?

506


What are the steps involved to fill a dataset?

558


How do I debug an asp.net application that was not written with visual studio.net and that does not use code-behind?

559






What is a postback ispostback and autopostback in asp net?

481


What are the advantages of using session?

441


What is Dynamic Web and discuss its usage with the help of real life examples?

600


How to display Alert in ASP.NET

651


1.What r collections? 2.What is .pdb file? 3.Is it possible to provide access to users in master page? 4.What is dirty n Phantom Read(SQL)? 5.What r different isolation levels(SQL)? 6.How to set authentication mode in web.config file?

1787


Explain MVC model binders?

601


How do I force the dispose method to be called automatically, as clients can forget to call dispose method?

515


Can you explain one critical mapping? Performance issue which one is better? Whether connected lookup tranformation or unconnected one?

814


What is the life cycle of web page?

529


Is asp.net different from asp? If yes, explain how?

498