Click here to Skip to main content
15,305,039 members

Comments by BlackWidowScarlet (Top 3 by date)

BlackWidowScarlet 18-Jun-18 1:25am View
   
I run the program under debugger and find out my error is using .read twice I updated my code with this but got an error on goTO

If myreader.HasRows() Then
                With ProgressBar.Value = 0
                End With
            End If

            Do While myreader.Read()

                myArray.Add(myreader.Item("vendor_name"))

                Dim x As Integer, y As Boolean
                Dim vDetail As String
                Dim vID As String
                Dim vDesc As String
                Dim vName As String = myreader.Item("vendor_name").ToString
                'Dim vID1 As String = myreader.Item("vendor_id").ToString
                Dim vEmail As String = myreader.Item("email_address").ToString

                txtmsg.Text = "Processing: " & vName & "'s Payroll..."
                txtmsg.Refresh()
                vDetail = ""
                vID = ""
                vID = myreader.Item("vendor_id").ToString
                irec = myArray.Add(myreader.Item("vendor_name"))
retry:
                vDetail = vDetail & vbCrLf
                vDetail = vDetail & "Invoice No.: " & myreader.Item("invoice_num").ToString
                vDetail = vDetail & " Amount: " & Format(myreader.Item("amount").ToString, "Standard")
                vDetail = vDetail & vbCrLf
                vDesc = myreader.Item("Description").ToString
                y = False
                For x = 1 To Len(vDesc)
                    If x Mod 70 = 0 Then
                        y = True
                    End If
                    If Mid(vDesc, x, 1) = " " And y Then
                        y = False
                        If x < Len(vDesc) Then
                            vDesc = Mid(vDesc, 1, x - 1) & vbCrLf & Mid(vDesc, x + 1)
                        End If
                    End If
                Next
                vDetail = vDetail & vDesc
                i = i + 1

                    If myreader.Item("vendor_id").ToString = vID Then
                        GoTo retry
                    End If

                i = i - 1

                With ProgressBar
                    .Value = 100
                    .Refresh()
                End With

                If vEmail <> "" Then SendMail(vEmail, vName, vDetail)

                i = i + 1

            Loop


            myreader.Close()
BlackWidowScarlet 31-May-18 19:54pm View
   
I already updated my codes as you advice. SO now, how I can send one email with multiple reimbursement?
BlackWidowScarlet 25-May-18 4:29am View
   
I got this error, so I think I need to have admin rights

System.Net.Mail.SmtpException: Failure sending mail.
System.Net.WebException: Unable to connect to the remote server
System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access
permissions 13.198.8.181.25 
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket,
IPAddress& address, ConnectSocketState state, IAsyncResult asyncresult, Int32 timeout, Exceptiona& exception)