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 are the types of session in asp.net?
Which is faster viewdata or viewbag?
Which authentication uses a combination of windows and iis authentication?
What is difference between singleton and single call?
What is difference between session and viewstate?
Which method is used to enforce garbage collection in .net?
What is the procedure to handle the process request using mhpm events fired? : asp.net mvc
What is the application pool?
What is the use of ASP.NET routing?
Why session is necessary in web application?
Where is the session stored?
Is asp.net and .net same?
What is the difference between asp.net and mvc?
What are the media types of http requests and response?
what are the events raised in asp.net page life cycle?in which stage view state can be loaded?