Dim code As String
Dim name As String
Dim category As String
Dim size As String
Dim productprice As Decimal
Dim sellingprice As Decimal
Dim count As String
Dim totalsales As Decimal
Dim stock As String
Dim newstocks As String
Dim pinvoice As String
For i = 0 To DGVReceipt.Rows.Count - 1
code = DGVReceipt.Rows(i).Cells(0).Value
name = DGVReceipt.Rows(i).Cells(1).Value
category = DGVReceipt.Rows(i).Cells(2).Value
size = DGVReceipt.Rows(i).Cells(3).Value
productprice = Decimal.Parse(DGVReceipt.Rows(i).Cells(4).Value)
sellingprice = Decimal.Parse(DGVReceipt.Rows(i).Cells(5).Value)
count = DGVReceipt.Rows(i).Cells(6).Value
totalsales = Decimal.Parse(DGVReceipt.Rows(i).Cells(7).Value)
stock = DGVReceipt.Rows(i).Cells(8).Value
newstocks = DGVReceipt.Rows(i).Cells(9).Value
pinvoice = DGVReceipt.Rows(i).Cells(10).Value
next
MyNonQuery(String.Format("insert into boyscout_pos.tbltransaction(Purchase_Invoice,Receipt_No,Date,Product_Code,Product_Name,Category,Size,Product_Price,Selling_Price,Stock_Out,Total) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')", pinvoice, receiptNo.Text, transactiondate.Text, code, name, category, size, productprice, sellingprice, count, totalsales))
What I have tried:
1st things 1st, I had a data that value of price like (250.75). I want to stored it into my mysql database, So convert productprice & sellingprice like what the code above but in effect. I encountered a warning "the value cannot be null parameter name: String".
How do I solved this.