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
Difference between .NET and previous version?
Can we set which type of comparison we want to perform by the CompareValidator control?
what is command line compiler.what are the steps and how it is related to debugging.
What are the various ways to send content from one page to another?
Explain what is an abstract class?
How can exception be handled with out the use of try catch?
What are the media types of http requests and response?
what is the difference between response.write() and response.output.write()?
What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?
What is the difference between the asp and asp.net?
Write a code snippet to implement the indentation in json in web api.
What is asp net_sessionid?
What is ASLM?
what are the ihttphandler and ihttphandlerfactory interfaces ?
What is the base class from which web forms are inherited?