Calling a Function in VB.NET Sub

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ANGELSDAGGER
    New Member
    • Aug 2007
    • 14

    #1

    Calling a Function in VB.NET Sub

    Do you know how to call a function in VB.NET. I have the following:
    [code=vbnet]
    Public Function GetFileContents (ByVal value As String, ByVal FullPath As String, Optional ByRef ErrInfo As String = "") As String

    Dim strContents As String
    Dim objReader As StreamReader
    Dim bAns As Boolean = False
    Dim i As Integer

    Try

    objReader = New StreamReader("L ast5.txt")
    For i = 0 To i < 4
    strContents = objReader.ReadT oEnd()
    objReader.Close ()
    Return strContents
    socket.SendData (strContents)
    Next

    Catch Ex As Exception
    ErrInfo = Ex.Message
    End Try


    End Function
    [/code]
    [code=vbnet]
    Public Function SaveTextToFile( ByVal strData As String, ByVal FullPath As String, Optional ByVal ErrInfo As String = "") As Boolean


    Dim bAns As Boolean = False
    Dim objReader As StreamWriter
    Try


    objReader = New StreamWriter("L ast5.txt")
    objReader.Write (strData)
    objReader.Close ()
    bAns = True
    Catch Ex As Exception
    ErrInfo = Ex.Message

    End Try
    Return bAns
    End Function

    [/code]
    And I want to call that Function after my SQL query has a result but it won't let me. Does anyone know?
    Last edited by Frinavale; Aug 8 '07, 06:10 PM. Reason: Added [code] tags to make more legible
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Hi AngelsDagger,

    Please refrain from double posting questions.
    Please review the posting guidelines for an outline of the rules that we follow here on theScripts. Particularly look over the section on double posting.

    Have you seen the response I've given to your question in your other thread?

    -Frinny

    Comment

    Working...