Seth Debug

Seth Debug

  • NA
  • 10
  • 722

Delete from List<> collection

Aug 4 2022 7:53 PM

Hi,

A collection is defined as follows for a class with UrunID, UrunAdi, UrunKategorisi, UrunFiyati properties.

List Urunler = new List();
Urun urun = new();
urun.UrunID = Convert.ToInt32(txtUrunID.Text);
urun.UrunAdi = txtUrunAdi.Text;
urun.UrunKategori = txtUrunKategori.Text;
urun.UrunFiyati = Convert.ToDecimal(txtUrunFiyati.Text);
Urunler.Add(urun);
dgvUrunler.DataSource = "";
dgvUrunler.DataSource = Urunler;

how to create add, delete, update and search methods for above collection?

Thanks.

 


Answers (7)