Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what are the ihttphandler and ihttphandlerfactory interfaces ?

997


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?

1038


Is it possible to change the index of primary key on table?

936


What is a 401 redirect?

990


Explain the components of web form in asp.net

1079


What are the different validators in asp.net?

1054


Why is asp.net so popular?

1019


Explain the significance of routing? : asp.net mvc

1098


Difference between application events and session events

1072


Why asp.net mvc is better than asp.net? : Asp.Net MVC

1230


What is razor? : asp.net mvc

1090


What is the significance of proxy user?

1147


Which is faster viewbag or viewdata?

1020


while developing webservices if i want some users to use my webservice only how can i give security to my webservice?

1903


What is the behavior of a Web browser when it receives an invalid element?

1148