title: insert data array using model table in database mvc c#
body: <p>Can you fix my problem? I try to insert data in table database oracle, but the data take from session array. 
  this code controller to insert data        </p>
  
  <pre><code>int[] NoId = (int[])Session["Id"];
  string[] NamaBarang = (string[])Session["namaBarang"];
  string[] HargaSatuan = (string[])Session["harga"];
  string[] JumlahBarang = (string[])Session["jumlah"];
  string[] HargaTotal = (string[])Session["total"];
  string[] Diskon = (string[])Session["disc"];
  string[] DPP = (string[])Session["Dpp"];
  string[] PPN = (string[])Session["Ppn"];
  
  MPMISTAX_DTLMASUK itemA = new MPMISTAX_DTLMASUK();
  itemA.KD_PPN = "2";
  itemA.KDUNIT = Kategori;
  itemA.KODE_SUPP = "M2Z";
  itemA.NOFAK = nomorFaktur;
  itemA.KDFAK = kodeFaktur;
  itemA.VKODECABANG = KodeMain;
  item.TAHUN = TanggalFak.Year;
  itemA.RETUR = "";
  itemA.NMBRG = NamaBarang[0];
  itemA.HRGSAT = HargaSatuan[0];
  itemA.NPWP = npwpPenjual;
  itemA.NODOK = "-";
  
  dbContext.MPMISTAX_DTLMASUK.Add(itemA);
  dbContext.SaveChanges();
  </code></pre>
  
  <p>I try using that code, but its error. I Hope you can help my problem. Thank you</p>