hello guys.. I'm mega in Indonesia. sorry for my english so bad.. I have script like :
private void btnDelete_Click(object sender, EventArgs e)
{
if (idx != -1)
{
int yy = Int32.Parse(txtTotal1.Text);
int ap = yy - Convert.ToInt16(arTotal[idx].ToString());
txtTotal1.Text = ap.ToString();
arId.RemoveAt(idx);
arNama.RemoveAt(idx);
arHarga.RemoveAt(idx);
arBanyak.RemoveAt(idx);
arTotal.RemoveAt(idx);
}
listView1.Items.Clear();
for (int i = 0; i < this.arId.Count; i++)
{
listView1.Items.Add(new ListViewItem(new string[] { arId[i].ToString(), arNama[i].ToString(), arHarga[i].ToString(), arBanyak[i].ToString(), arTotal[i].ToString() }));
}
}
{
if (idx != -1)
{
int yy = Int32.Parse(txtTotal1.Text);
int ap = yy - Convert.ToInt16(arTotal[idx].ToString());
txtTotal1.Text = ap.ToString();
arId.RemoveAt(idx);
arNama.RemoveAt(idx);
arHarga.RemoveAt(idx);
arBanyak.RemoveAt(idx);
arTotal.RemoveAt(idx);
}
listView1.Items.Clear();
for (int i = 0; i < this.arId.Count; i++)
{
listView1.Items.Add(new ListViewItem(new string[] { arId[i].ToString(), arNama[i].ToString(), arHarga[i].ToString(), arBanyak[i].ToString(), arTotal[i].ToString() }));
}
}
but error in "int ap = yy - Convert.ToInt16(arTotal[idx].ToString());" can you help me ?

Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 25, 2015, 7:13 PM EDT
Mega Saraswati34 reputationPosted Jun 25, 2015, 7:15 PM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 25, 2015, 7:44 PM EDT
{
if condition will not execute
Mega Saraswati34 reputationPosted Jun 25, 2015, 7:56 PM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 25, 2015, 11:14 PM EDT
Mega Saraswati34 reputationPosted Jun 25, 2015, 11:54 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 25, 2015, 11:59 PM EDT
Mega Saraswati34 reputationPosted Jun 26, 2015, 12:03 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 26, 2015, 12:38 AM EDT