After connecting to the database in asp.net using c# as the language
I want update the table using my application where i give the details in the text box present in the application should be updated in the table....
i need the ccoding...
Loading
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
Vishnujeet KumarRank #1,019 · 1.9K reputationPosted Dec 3, 2012, 9:50 PM EST
Rajan Ghorecha2 reputationPosted Dec 3, 2012, 10:54 PM EST
is in the .cs file
protected void upd_Click(object sender, EventArgs e)
{
SqlConnection cn = new SqlConnection(@"Put the Connection String");
cn.Open();
SqlCommand cmd = new SqlCommand("UPDATE Cust_master SET Name ='" + TextBox2.Text.Trim() + "', Contact ='" + TextBox3.Text.Trim() + "', Address ='" + TextBox4.Text.Trim() + "'WHERE Cust_id =" + TextBox1.Text.Trim() + "", cn);
cmd.ExecuteNonQuery();
cn.Close();
load();
}
also code file is atteched here
Ajith s9 reputationPosted Dec 4, 2012, 6:38 AM EST
Vishnujeet KumarRank #1,019 · 1.9K reputationPosted Dec 5, 2012, 4:56 AM EST
Please mark answer as accepted answer if it resolves your problem.