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
Explain the difference between asp and asp.net?
How can we create pie chart in asp.net?
What is the difference between executescalar and executenonquery?
What is caching in asp.net?
What is authentication in asp.net?
What is asp.net? How is it different from asp?
Explain the difference between asp.net mvc and asp.net webforms? : asp.net mvc
What does postback mean?
Explain the difference between Web Garden and Web Farm?
What is Cookies Less Session?
Tell me what is the request flow used for asp.net mvc framework? : asp.net mvc
What is user control in asp.net?
What is globalization and localization in asp net?
What is OSI layer? Explain different layers.
Is sql backend or frontend?