Jump to content
Software FX Community

chaitanya_u

Members
  • Posts

    1
  • Joined

  • Last visited

chaitanya_u's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I have created an application which reads data from barcode. However Iam getting an error: "Input stringwas not in a correct format" private void UpdateDB() { if (lblBilledItemTotal.Text == "") { lblBilledItemTotal.Text ="0"; } double billedTotal = Convert.ToDouble(lblBilledItemTotal.Text); double billDisc = Convert.ToDouble(txtBillDiscCash.Text); double netPayable = Convert.ToDouble(lblNetPayableAmount.Text); po.AddBillData(billedTotal, billDisc, netPayable, DateTime.Now.ToShortDateString()); ClearDS(); ds = po.GetLatestBillNo(); int billNo = Convert.ToInt32(ds.Tables[0].Rows[0].ItemArray.GetValue(0)); foreach (DataGridViewRow dgR in dgItems.Rows) { if (dgR.Cells["dgColProdCode"].Value != null) { itemCode = dgR.Cells["dgColProdCode"].Value.ToString(); itemName = dgR.Cells["dgColItemDescription"].Value.ToString(); itemPrice = Convert.ToDouble(dgR.Cells["dgColPrice"].Value); itemQty = Convert.ToInt32(dgR.Cells["dgColQuantity"].Value); itemDiscCash = Convert.ToDouble(dgR.Cells["dgColItemDiscCash"].Value); itemDiscPercent = Convert.ToDouble(dgR.Cells["dgColItemDiscPercent"].Value); itemTotal = Convert.ToDouble(dgR.Cells["dgColTotal"].Value); po.AddSalesData(billNo, itemCode, itemName, itemQty, itemDiscCash, itemDiscPercent, itemPrice, billedTotal, DateTime.Now); } }
×
×
  • Create New...