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
Can you edit data in the Repeater control? Which template must you provide, in order to display data in a Repeater control? How can you provide an alternating color scheme in a Repeater control? What property must you set, and what method must you call in your code, in order to bind the data from some data source to the Repeater control?
What is in a session cookie?
Define xmlreader class.
How to make sure that contents of an updatepanel update only when a partial postback takes place (and not on a full postback)?
What is the use of placeholder control?
What is state management react?
while developing webservices if i want some users to use my webservice only how can i give security to my webservice?
How does u get record no from 5 to 15 from a dataset of 100 records?
what is a .xap file? Explain with an example.
Explain cashing in asp.net.
How do you remove duplicates without using remove duplicate stage?
What is postback and autopostback in asp.net?
Which protocol is used to call web service?
How is application management and maintenance improved in asp.net 2.0?
Are there any resources for drop-in replacements for the default css that comes with the ASP.NET Website template?