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 ihttphandler and ihttphandlerfactory interfaces ?
Asp pages that worked pefectly on windows 2000 server and iis 5.0 do not work on windows 2003 server with iis 6.0. Asp.net pages work fine. Why?
Is it possible to change the index of primary key on table?
What is a 401 redirect?
Explain the components of web form in asp.net
What are the different validators in asp.net?
Why is asp.net so popular?
Explain the significance of routing? : asp.net mvc
Difference between application events and session events
Why asp.net mvc is better than asp.net? : Asp.Net MVC
What is razor? : asp.net mvc
What is the significance of proxy user?
Which is faster viewbag or viewdata?
while developing webservices if i want some users to use my webservice only how can i give security to my webservice?
What is the behavior of a Web browser when it receives an invalid element?