I have an application I want to do it 1 - Enter the details first 2 - Receive invoice 3 (maximum) - with ID Enter the details of the invoice, it gives me this error index out of range.
Enter private entries () as the date of the invoice date as dated date = Today the integer in the form of DIDIID ID as an integral slow client, as a low note string if the clients.Visible = true Then user id = 1 client = 2 note = "cache" other userid = 2 client = 6 note = "credit" and dim query 1 as "string" = "insert in invoice" ([purchased], client, [note] , User id, total, disk) value ('' & amp; cite (invoiceday) & amp; "',' & amp; Clientid & amp; amp; ", & quot; & amp; note & amp; & quot;, & quot;, & amp; userid & amp;; & quot ;, & quot; totalprice.Text & amp; & quot; & quot; & quot; & quot; & quot; & quot; & amp; ; Txtdis.Text & amp; "')" Each line contains DatasearchViewRow as dvsale.Rows dim query string = "as inserting samselect2 (QUERY1) for dim maxinvoice integer maxinvoice = invoiceid ()' '; Maxinvoice + 1 & amp; & Amp; "'invoicede (invoiceid, barcode, doaname, quantity, value, qtyprice) value in (& quot; & quot; row & quot; row & quot; row & quot; row & quot; row (" barcode " Price ("denum"). Price & amp; "'," "& Amp; line Seals (" Quantity "). Value &"', "" & Amp; line Seals ("Value") Value & amp; "," & # 39; Amp; line Seals ("Tacti"). Value & amp; ";)" Samselect2 (Query) Next End Sub
This samselect2 < / P>
class of public sub-samselect2 (byVal SQL string) attempt to thief. Open () cmd .Connection = thief .CommandText = SQL pre-capture exceptions (ex.Message, MsgBoxStyle.Exclamation) as the MsgBox con.Close (try) da.Dispose () End Sub
and the maximum number of invoiceid private function invoiceid () checkConnection () in the form of a slow strQ string = "MaxInvoice" OleDbCommand as the slow cmdQ = new OleDbCommand (Strq, con) dim result = cmdQ.ExecuteScalar () If there is no result, then anything as integer = dvd = 0 returns x or returned The final function
No comments:
Post a Comment