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
Explain how dot net compiled code will become platform independent?
What is slidemaster?
Why would a company use an application service provider?
What does ascx stand for?
What are the ways of preserving data on a Web Form in ASP.NET?
What is new asp.net core?
Explain method to handle error using HttpError in Web API?
How does the iis work?
What role “#&&” plays in a querysting?
If you have an application with multiple security levels though secure login and my ASP.NET web appplication is spanned across three web-servers by using round-robbin load balancing. Explain which is the best approach to maintain login-in state for the users?
Explain about secure socket layer?
What are the steps involved to fill a dataset?
What is session mode in asp.net?
What is a session government?
What are the validation controls available in ASP.NET?