How to Insert a TextBox value in to Sql database using C#
coding?
Answer Posted / ramachandraprabu
SqlConnection conn = new SqlConnection(strCon);
SqlCommand CmdSql = new SqlCommand("INSERT INTO Customers
(Firstname,Lastname,Address)Values('" + textbox1.Text
+ "', '"+textbox2.Test+"', '"+textbox3.Text+"')", conn);
CmdSql.ExecuteNonQuery();
\\If u use Html control we must use
textbox1.value
\\If u use asp.net controls we have to use
textbox1.text
Is This Answer Correct ? | 51 Yes | 23 No |
Post New Answer View All Answers
What are resource file and how do we generate resource file?
Whta are the Various steps taken to optimize a web based application (caching, stored procedure etc.) ?
What is the use of response redirect in asp.net?
What is latest version of asp.net mvc? : Asp.Net MVC
Explain how do you deploy your asp.net application?
How do you store a value in viewstate and retrieve them?
What is the difference between user control and custom control?
How ASP.NET page works?
Define viewstate in .net?
Can the unique key be null?
What are the events that happen when a client requests an asp.net page from iis server?
How to create discussion forum in asp.net mvc? : Asp.Net MVC
How to display validation messages in one control?
What New Features comes with ASP.NET Web API 2.0?
Explain what is clr?