Advertisement
YagizYurek

Telefon Kayıt Programı

Mar 28th, 2018
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.59 KB | None | 0 0
  1.   try
  2.             {
  3.                 AccessDataSource1.InsertCommand = ("insert into tablo (imeino,marka,model,ekranb,ram,islemci,fiyat) values('" + TextBox1.Text + "', '" + TextBox2.Text + "', '" + TextBox3.Text + "', " + TextBox4.Text + ", '" + TextBox5.Text + "', '" + TextBox6.Text + "'," + TextBox7.Text + ")");
  4.                 AccessDataSource1.Insert();
  5.                 Label1.Text = "Kaydedildi";
  6.             }
  7.             catch
  8.             {
  9.                 Label1.Text = "Kaydedilemedi";
  10.             }
  11.         }
  12.  
  13.         protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
  14.         {
  15.             try
  16.             {
  17.                 AccessDataSource1.UpdateCommand = ("update tablo set marka='" + TextBox2.Text + "', model='" + TextBox3.Text + "', ekranb=" + TextBox4.Text + ", ram='" + TextBox5.Text + "', islemci='" + TextBox6.Text + "', fiyat=" + TextBox7.Text + " where imeino='" + TextBox1.Text + "'");
  18.                 AccessDataSource1.Update();
  19.                 Label1.Text = "Kayıt güncellendi";
  20.             }
  21.  
  22.             catch
  23.             {
  24.                 Label1.Text = "Kayıt güncellenemedi";
  25.             }
  26.         }
  27.  
  28.         protected void ImageButton3_Click1(object sender, ImageClickEventArgs e)
  29.         {
  30.             try
  31.             {
  32.                 AccessDataSource1.DeleteCommand = ("delete from tablo where imeino='" + TextBox1.Text + "'");
  33.                 AccessDataSource1.Delete();
  34.                 Label1.Text = "Silindi";
  35.             }
  36.             catch
  37.             {
  38.                 Label1.Text = "Silinemedi";
  39.             }
  40.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement