Advertisement
Guest User

Untitled

a guest
May 3rd, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.29 KB | None | 0 0
  1.     Private Function updateInvoiceAndPayment() As Boolean
  2.         Try
  3.             Dim conn As String = "Driver={MySQL ODBC 5.1 Driver};Server=173.15.24.2;Database=wsc; User=root;Password=Viku1988!;Option=3;"
  4.  
  5.             Dim dbConn2 As New OdbcConnection(conn)
  6.             dbConn2.Open()
  7.  
  8.             Dim invoiceSQL As String = "INSERT INTO wsc.invoice (contNum, empID, medID, medQTY, ordTotal, orderID) VALUES('" + contNum + "','" + Request.QueryString("empID") + "','" + medID + "','" + medQTY + "','" + ordTotal + "','" + Request.QueryString("orderID") + "')"
  9.             Dim paymentSQL As String = "INSERT INTO wsc.payment (ordID, payTYPE, deposit) VALUES('" + Request.QueryString("orderID") + "','" + payTYPE.Text + "','" + deposit.Text + "')"
  10.  
  11.             Dim invoiceCommand As New OdbcCommand
  12.             invoiceCommand.Connection = dbConn2
  13.             invoiceCommand.CommandText = invoiceSQL
  14.             invoiceCommand.ExecuteNonQuery()
  15.  
  16.             Dim paymentCommand As New OdbcCommand
  17.             paymentCommand.Connection = dbConn2
  18.             paymentCommand.CommandText = paymentSQL
  19.             paymentCommand.ExecuteNonQuery()
  20.  
  21.  
  22.             dbConn2.Close()
  23.  
  24.             Return True
  25.  
  26.         Catch ex As Exception
  27.             Return False
  28.  
  29.         End Try
  30.  
  31.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement