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
How can I have a particular web page in an asp.net application which displays its own error page?
Which method is used to enforce garbage collection in .net?
Is redux flux?
Can more than one person use the same login?
Explain login control and form authentication.
Is it possible for me to change my aspx file extension to some other name?
what are configuration files?
Explain method to handle error using HttpError in Web API?
What is difference between datalist and gridview?
How to disable disable browser's Back button in asp.net (JavaScript)?
What is the difference between web.config and machine.config in ASP.NET?
Describe the differences between the lifecycles of Windows services and Standard EXE?
What is a swagger in web api?
How to create discussion forum in asp.net mvc? : Asp.Net MVC
How can we pass info between 2 asp.net pages?