Tuesday, April 17, 2018

ASP.NET Update Sql Table using TextBox

 protected void ButtonTDSDuzenle_Click(object sender, EventArgs e) { SqlConnection baglanti = new SqlConnection(ConfigurationManager.ConnectionStrings["KayitConnectionString"].ToString()); baglanti.Open(); string duzenle = "update Tasit SET Surucu = '" +TextBoxSDuzenle.Text+ "' Hostes = '" + TextBoxHDuzenle.Text + "' Guzergah = '" + TextBoxGDuzenle.Text + "' Ucret = '" + TextBoxUDuzenle + "' WHERE TasitNumara = '" +DropDownListTNSec.SelectedIndex.ToString()+ "'"; SqlCommand kom = new SqlCommand(duzenle, baglanti); kom.ExecuteNonQuery(); baglanti.Close(); } 

I am trying to update table with textboxs. I am a newbie, so i prefer codes similar to this one. Can you fix this?

ASP.NET Update Sql Table using TextBox Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team