Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My code in vb like that i need the code in vb.net
VB
rsSUP.Seek "=", maccount_number
               If rsSUP.NoMatch = False Then
                   tmpArry = Split(rsSUP.Fields("sup_data"), "|", , vbTextCompare)
                   trn_header = rsSUP.Fields("sup_data") + "|" + mPERIOD 'check here

So pls help how can i find it using recordset in vb.net using mysql
Posted
Updated 10-Jan-12 20:15pm
v3

1 solution

You can try the below generic VB .NET methods for getting text and a particular word in file text with seek operation.

VB
Imports System.IO
Imports System.Text.RegularExpressions

Public Class FileReader
    Public Function GetText(ByVal PathToFile as String)
        Dim fs as New FileStream(PathToFile, FileMode.Open)
        Dim sr as New StreamReader(fs)  
        Dim FileText as string
        
        FileText = sr.ReadToEnd
        
        Return FileText
    End Function

    Public Function FindWordPosition(ByVal FileText as String, ByVal Pattern As String)
        Dim match as Match
        Dim myRegex as New Regex(Pattern)
        match = myRegex.Match(FileText)
        Return match.Index 
    End Function

End Class
 
Share this answer
 
Comments
taher ahmed choudhury 11-Jan-12 0:54am    
i want to find it in table of databse by reading text file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900