Insert data into database
hi, I need code how to insert data into database, please help me
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Feb 18, 2014, 2:38 AM EST
http://www.codeproject.com/Articles/45421/Gracefully-Inserting-a-Row-into-an-ASP-NET-GridVie
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Feb 18, 2014, 2:11 AM EST
e.g.
using (SqlConnection connection = new SqlConnection(connectionString)) { SqlCommand cmd = new SqlCommand("INSERT INTO Data (Name, PhoneNo, Address) VALUES (@Name, @PhoneNo, @Address)"); cmd.CommandType = CommandType.Text; cmd.Connection = connection; cmd.Parameters.AddWithValue("@Name", txtName.Text); cmd.Parameters.AddWithValue("@PhoneNo", txtPhone.Text); cmd.Parameters.AddWithValue("@Address", txtAddress.Text); connection.Open(); cmd.ExecuteNonQuery(); }Rashmi dev10 reputationPosted Feb 18, 2014, 2:13 AM EST
Biswa Pujarini MohapatraRank #465 · 5.4K reputationPosted Feb 18, 2014, 2:14 AM EST
Sanjay KumarRank #561 · 4.3K reputationPosted Feb 18, 2014, 2:49 AM EST
http://www.c-sharpcorner.com/UploadFile/0c1bb2/inserting-form-data-into-database-and-display-it-in-gridview/
http://www.c-sharpcorner.com/UploadFile/0c1bb2/inserting-from-data-into-database-using-stored-procedure-in/
http://www.c-sharpcorner.com/UploadFile/47548d/simple-insert-select-update-and-delete-in-Asp-Net-using-mysq/