VB6 to C#

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
 
J

Jeffrey Tan[MSFT]

Hi Mickey,

I have found that this post has been posted in C# queue. I have replied you
in C# queue.
Please follow up there, I will work with you.
Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Mickey Swanson" <[email protected]>
| Subject: VB6 to C#
| Date: Sun, 16 Nov 2003 18:16:43 -0600
| Lines: 63
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: r166h97.dixie-net.com 64.89.166.97
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:115792
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| 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
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top