Private Sub AddEntry()
Dim cnSQL = New OleDbConnection(con)
Try
cnSQL.Open()
strSQL = "insert into tblbilling(InvoiceNo,[Sold to],Address,tin,date,itemid,description,quantity,unit,unitprice,total,Gross,vat,[total invoice]) Values('" & txtInvoiceNo.Text & "','" & txtsold.Text & "','" & txtaddress.Text & "','" & txttin.Text & "','" & txtdate.Text & "' ,'" & txtItemID.Text & "' ,'" & txtparticulars.Text & "'," & txtquantity.Text & ",'" & txtunit.Text & "'," & txtunitcost.Text & "," & txtTa.Text & "," & txtgsp.Text & "," & txtvat.Text & "," & txttia.Text & ")"
Dim cmSQL As New OleDbCommand(strSQL, cnSQL)
cmSQL.ExecuteNonQuery()
Dim strSQL1 As String = "insert into tempBilling(InvoiceNo,[Sold to],Address,tin,date,itemid,description,quantity,unit,unitprice,total,Gross,vat,[total invoice]) Values('" & txtInvoiceNo.Text & "','" & txtsold.Text & "','" & txtaddress.Text & "','" & txttin.Text & "','" & txtdate.Text & "' ,'" & txtItemID.Text & "' ,'" & txtparticulars.Text & "'," & txtquantity.Text & ",'" & txtunit.Text & "'," & txtunitcost.Text & "," & txtTa.Text & "," & txtgsp.Text & "," & txtvat.Text & "," & txttia.Text & ")"
Dim cmSQL1 As New OleDbCommand(strSQL1, cnSQL)
cmSQL1.ExecuteNonQuery()
cmSQL1.Dispose()
cnSQL.Close()
Catch Exp As OleDbException
MsgBox(Exp.Message, MsgBoxStyle.Critical, "SQL Error") ''
Catch Exp As Exception
MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error")
End Try
End Sub
No comments:
Post a Comment