Hi All
This is my first post at this forum and hope I will get result in it.
I wrote a code in vb.net 2010
I don't know what is the problem as this code work in another form.
Please I will really appreciate help.
Regards.
This is my first post at this forum and hope I will get result in it.
I wrote a code in vb.net 2010
Code:
Con.Open()
Dim cmd1 As New OleDbCommand
cmd.Connection = Con
cmd1.Connection = Con
cmd.CommandText = "insert into Order values(" & Val(frmSalesInvoice.lblMax.Text) & ", '" & frmSalesInvoice.cmbPrname.Text & "'," & Val(frmSalesInvoice.cmbCardType.Text) & "," & Val(frmSalesInvoice.txtCode.Text) & "," & Val(frmSalesInvoice.txtQty.Text) & "," & Val(frmSalesInvoice.txtPrice.Text) & "," & Val(frmSalesInvoice.txtDisc.Text) & "," & Val(frmSalesInvoice.txtTotal.Text) & ",'" & Now.Date & "','" & frmSalesInvoice.cmbSID.Text & "')"
cmd1.CommandText = "insert into SalesInvoiceGrid values(" & Val(frmSalesInvoice.lblMax.Text) & ", '" & frmSalesInvoice.cmbPrname.Text & "'," & Val(frmSalesInvoice.cmbCardType.Text) & "," & Val(frmSalesInvoice.txtCode.Text) & "," & Val(frmSalesInvoice.txtQty.Text) & "," & Val(frmSalesInvoice.txtPrice.Text) & "," & Val(frmSalesInvoice.txtDisc.Text) & "," & Val(frmSalesInvoice.txtTotal.Text) & ",'" & Now.Date & "','" & frmSalesInvoice.cmbSID.Text & "')"
'Execute scalar function is used to hold one value
cmd.ExecuteNonQuery()
cmd1.ExecuteNonQuery()
Con.Close()
MsgBox("New Product Saved in Stock")
Con.Close()
Con.Dispose()
Please I will really appreciate help.
Regards.