Advertisement
YagizYurek

Kitap Kayıt Programı

Mar 28th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.53 KB | None | 0 0
  1.             try
  2.             {
  3.                 AccessDataSource1.InsertCommand = ("insert into ktp (isbn,adi, turu,yazari,fiyat,btarihi) values('" + TextBox1.Text + "', '" + TextBox2.Text + "', '" + TextBox3.Text + "', '" + TextBox4.Text + "', " + TextBox5.Text + ", '" + TextBox6.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 ktp set adi='" + TextBox2.Text + "', turu='" + TextBox3.Text + "', yazari='" + TextBox4.Text + "', fiyat=" + TextBox5.Text + ", btarihi='" + TextBox6.Text + "' where isbn='" + 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_Click(object sender, ImageClickEventArgs e)
  29.         {
  30.             try
  31.             {
  32.                 AccessDataSource1.DeleteCommand = ("delete from ktp where isbn='" + 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