Solved, need help in pass in parameter to function---absolute beginner

Posted on 2006-05-21
Last Modified: 2010-04-23
While ds.Tables(0).Rows.Count >= i
                            If ds.Tables(0).Rows.Count = i Then
                            item = item + "  " + tempDir.GetFiles("*.txt")(f).Name --- Storing item value in a variable, need to pass in this item value sendemail function
                            Exit While
                        End If
                        If (Mid(tempDir.GetFiles("*.txt")(f).Name, 1, tempDir.GetFiles("*.txt")(f).Name.Length - 19) = ds.Tables(0).Rows.Item(i)(0)) Then Exit While

                        i = i + 1
                    End While
                    f = f + 1
                End While
                'Exit Sub
                ''''' End If
                ' Next
                ProgressBar1.Value = 100
                MsgBox(item) --------------------How to call the sendemail function.
                ????? How to call the sendemail function here and how to pass in the item value to the below function
                ProgressBar1.Value = 0
                Exit Sub
                End If

Public Function SendEmail(....)   ----I dont know how pass the item from the above code to this function

Dim strEmail As String = ""

Dim strServer As String = ""

Dim strSubject As String = "Item missing"

Dim strBody As String

Dim mail As New MailMessage

Dim sm As SmtpMail

strBody = "The missing item is + ........"  How to add the above code item to here

mail.Cc = ""

mail.To = strEmail

mail.Subject = strSubject

mail.Body = strBody

mail.From = ""

mail.BodyFormat = MailFormat.Html

sm.SmtpServer = strServer


End Function

Please help.................
Question by:nyee84
    LVL 69

    Accepted Solution

    Hi nyee84,

    > Public Function SendEmail(....)
    Public Function SendEmail(byval pMessage as string)

    strBody = "The missing item is + ........"  How to add the above code item to here
    strBody = "The missing item is : " + pMessage

    Then call the method:

    LVL 69

    Expert Comment

    by:Éric Moreau

    BTW, you need to close your open questions by accepting comments! You have 19 questions that are still open.
    LVL 69

    Expert Comment

    by:Éric Moreau
    will you close your 18 other questions?

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
    Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video discusses moving either the default database or any database to a new volume.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now