C
Cdude
1 public void AddItem(string itemCode)
2 {
3 DataRow[] itemRow = DBAdmin.Products.Select("Code =
'"+itemCode+"'");
4 addItemRow["Code"] = itemRow[0]["Code"].ToString();
5 addItemRow["Amount"] = itemRow[0]
["SellPriceIn"].ToString();
6 addItemRow["Vat"] = itemRow[0]["Vat"].ToString();
7 addItemRow["Qty"] = 1;
8 addItemRow["DocNo"] = 2;
DBAdmin.DLitem.Rows.Add(addItemRow);
}
This my code and this is the error i get on line 4
"Index was outside the bounds of the array"
Any suggestions ? on what i am doing wrong
2 {
3 DataRow[] itemRow = DBAdmin.Products.Select("Code =
'"+itemCode+"'");
4 addItemRow["Code"] = itemRow[0]["Code"].ToString();
5 addItemRow["Amount"] = itemRow[0]
["SellPriceIn"].ToString();
6 addItemRow["Vat"] = itemRow[0]["Vat"].ToString();
7 addItemRow["Qty"] = 1;
8 addItemRow["DocNo"] = 2;
DBAdmin.DLitem.Rows.Add(addItemRow);
}
This my code and this is the error i get on line 4
"Index was outside the bounds of the array"
Any suggestions ? on what i am doing wrong