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?
[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?
Comment