Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Translate VB to C#
Message
From
11/12/2013 09:31:59
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Translate VB to C#
Environment versions
Environment:
C# 4.0
OS:
Windows 8
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01589830
Message ID:
01589830
Views:
67
Hi,

I have been given some code for VB.NET and am trying to re-write it in C# (really just as an exercise in understanding what it is trying to do) but am stuck on this line:
Dim commands As String() = alterScopeSql.Split(New String() {"GO" & vbCr & vbLf, "GO ", "GO" & vbTab, "GO"}, StringSplitOptions.RemoveEmptyEntries)
this is part of the following:
            Dim strConnectionString As String = ""
            strConnectionString = Settings(tcMode)
            Using connection = New SqlConnection(strConnectionString) 'New SqlConnection(toConnection.ConnectionString)
                connection.Open()
                Dim commands As String() = alterScopeSql.Split(New String() {"GO" & vbCr & vbLf, "GO ", "GO" & vbTab, "GO"}, StringSplitOptions.RemoveEmptyEntries)
                For Each c As String In commands
                    Dim command = New SqlCommand(c, connection)
                    command.ExecuteNonQuery()
                Next
            End Using
I would appreciate an explanation of what this line of code is trying to do and may need some help in translating it to C#.

Thanks
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Next
Reply
Map
View

Click here to load this message in the networking platform