How to Insert a TextBox value in to Sql database using C#
coding?
Answer Posted / balakumar
string strconn = @"Data Source=localhost;
Initial Catalog=Bala;
Trusted_Connection=yes;";
SqlConnection conn = new SqlConnection(strconn);
conn.Open();
string insertcommand = "insert into Employee
values('" + TextBox1.Text + "','" + TextBox2.Text + "','" +
TextBox3.Text + "')";
SqlCommand cmd = new SqlCommand(insertcommand, conn);
cmd.ExecuteNonQuery();
conn.Close();
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is asp short for?
What is web configuration file and how to use in web application
What are the different methods of session maintenance in asp.net?
Which property needs to be set for script manager control to extend the time before throwing time out expection if no response is received from the server?
Hi All, Im an MCA holder with 3+ years of experience in asp.net. Now i want to move to some good government job. I have no idea about different categories of exams held & which one can be applicable for my education background. I have done B.A with MCA. Please help me out with your valuable suggestions. I would be very grateful. Thanks Anuj
Out of ASP or ASP.NET which one is stateless?
Explain the asp.net mvc request life cycle? : asp.net mvc
What would be salary for 8+ years of experience in ASP.NET in different metro city in india?
How do you store a value in viewstate and retrieve them?
How do you use viewstate?
Why is global asax is used for?
What is difference between view state and session state?
What is a postback in asp net?
Explain how cookies work. Give an example of cookie abuse.
What does aspcompat="true" mean?