Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Translate VB to C#
Message
De
11/12/2013 09:31:59
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Translate VB to C#
Versions des environnements
Environment:
C# 4.0
OS:
Windows 8
Network:
Windows 2000 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01589830
Message ID:
01589830
Vues:
66
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform