M
Mickey Swanson
I need some help converting the following to c#.
I'm new to the dotnet stuff so any help or pointers would be appreciated
I'm having trouble finding the replacements for InStr and Mid$
Public Function SQLText(ByVal sData As String) As String
Dim strTemp As String
Dim StrTemp2 As String
Dim intX As Integer
Dim intY As Integer
intX = InStr(1, sData, "'")
If intX > 0 Then
strTemp = Mid$(sData, 1, intX)
strTemp = strTemp & "'" & Mid$(sData, intX + 1)
intY = InStr(intX + 2, strTemp, "'")
Do Until intY = 0
StrTemp2 = Mid$(strTemp, 1, intY)
strTemp = StrTemp2 & "'" & Mid$(strTemp, intY + 1)
intY = InStr(intY + 2, strTemp, "'")
Loop
Else
strTemp = sData
End If
SQLText = "'" & Trim$(strTemp) & "'"
End Function
Mickey Swason
I'm new to the dotnet stuff so any help or pointers would be appreciated
I'm having trouble finding the replacements for InStr and Mid$
Public Function SQLText(ByVal sData As String) As String
Dim strTemp As String
Dim StrTemp2 As String
Dim intX As Integer
Dim intY As Integer
intX = InStr(1, sData, "'")
If intX > 0 Then
strTemp = Mid$(sData, 1, intX)
strTemp = strTemp & "'" & Mid$(sData, intX + 1)
intY = InStr(intX + 2, strTemp, "'")
Do Until intY = 0
StrTemp2 = Mid$(strTemp, 1, intY)
strTemp = StrTemp2 & "'" & Mid$(strTemp, intY + 1)
intY = InStr(intY + 2, strTemp, "'")
Loop
Else
strTemp = sData
End If
SQLText = "'" & Trim$(strTemp) & "'"
End Function
Mickey Swason